Refactor for multiple backend support

This is a prequel to adding etcd support (https://github.com/airbnb/synapse/issues/35) - just adds dynamic backend support (defaulting to the zookeeper backend), giving a place to plug in etcd.