I'm wrestling with the same thing. I can get the code working with a few tricks (because I'd like to use it in a module template instead of a pagelayout template). On the other hand, I'm not 100% the code is working correctly because I don't see any unstyled content.
But the stylesheet rules are giving me a headache. There's a stylesheet named treemenu.css but it apparently doesn't have all stylesheet rules because the admin design doesn't even load it.