Broad refactoring and cleanup.

* Use vagrant-hosts for hosts file manipulation
* Increased robustness
* Cleanup old code