Implement subscriptions

Ready to merge.