Jrbl refactoring left nav (and top nav)

@jbau, please take a look.

I do a lot of fidgety things to leftnav() and friends, but the real gains come from strategic caching in get_common_page_data. Holy wow.

Loading /db/winter2013/leftnav on my laptop has gone from 1200 SELECTs to 6.

My manual testing looks good to me, but please read carefully to ensure I'm not hallucinating.