Background jobs

This changeset introduces an abstraction for (maintenance) jobs running in the background, of which execution may be triggered from other threads. SubscriptionManager could very well use this, but I haven't made it do so yet.

@xor-freenet Unit tests are not complete, I'll be finishing those tomorrow. I'm filing this pull request early so you can have a look at it already.
Thanks for noticing (and also for noticing that it's not a real problem ☺). Fixed in a3e03917706d7e4ac7f79118ea6ad10d7b6a16bf.