Multisite support

This enables multisite support in Refinery. The basic functionality seems to work well, but there is a bunch of admin UI stuff that can be done to make this nicer.