Fix compile-and-serve process

This makes compile and serve work better with static_url. It undoes
some of the assumptions and cleans things up a bit.