Move to unittest and consolidate Site methods

I made a lot of small changes here, but the important parts were consolidating
several of the generation steps into prepare_pages and moving to testing with
unittest.