Fix vhosts for https and fix vhost dependence on sorting of values in the config system which isn't guaranteed. Make vhost test cases more robust. Closes COUCHDB-1103 Source patch by Benoit and tests patch by me.