Redesign subscription API and update to new spec.
Add event queue memory limitation test.
Polish tests, fix a cross-test side effect.