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.~~
Just a FYI, will merge even if you don't fix this: I decided to quite adding the ```@author``` tag since ```git blame```  can be used to determine authorship with much more precision (or ```git bisect``` if after authorship the file was changed by people in a way which doesn't change the actual code, such as whitespace changes). - People frequently forget to update the tag. Also, its rather annoying to have to update it. And in open source, many people work on individual files, so it would bloat the files a lot to have to add authorship to individual functions etc.

-> Done, no change required, just FYI.