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.
So terminate() is a non-blocking call which schedules termination and waitForTerminate() waits for termination to actually happen?
You should JavaDoc that at terminate(), because the way the JavaDoc currently reads, it sounds like it is a blocking call which does what waitForTermination() actually does.
Maybe also rename terminate() to scheduleTermination().