Bugfixes in replicator and support for document subscriptions.
Cleanup.