Fixed up some of the deployment/turn glue that was broken by the rewrite, restructured the code with new regions and added some more comments