libraries/singularity: changing subscription metadata

Implementing the ideas of event "chains." Easier to see how events
propagate through the system, what other events they trigger.

Also prepares the DB component to be used / controlled like a
plugin.