Refactor parts of the vhost lwrp into a library

This also adds per vhost self signed certificates by default.