Add support for multisite and proxy

Closes #11 with a few changes.