Refactor vhost improvements

This is for #24 with discussed changes so that `custom_fragment` accepts static content, and adds spec tests.