Refactor towards making subscriptions faster.
Merge branch 'master' into faster-subscriptions
Merge branch 'master' into faster-subscriptions

Conflicts:
	update-blocks.js
Merge branch 'master' into faster-subscriptions
Look up subscriptions only once on fanout, and bugfixes from testing.
Improve log messages.
Improve comments and add missing return statement.