Move default hosting environment code

Proxy pull request for @davidfowl. Making some more progress on hosting cleanup. This likely breaks other components. We need to check things like Helios before it's merged.