all fast

This gives us all the speedups we wanted.
I get ~6 seconds for a noop build in yelpmain, and 26s for a rebuild-from-cache.

I'm sorry the patch is so big.
I made a couple false starts, and removed a good amount of code that was added in the intermediate commits.
I've left them in the history however because they were generally correct and might prove useful in future.
comment has rotted