Improved vhost and tests to go with it.