Subscription Refactoring

This refactors the whole email subscription handling into a class and adds a few test cases.

This probably fixes FS#2580 but I'm not sure we should merge this before the release as this might still have some bugs.

@adrianlang it would be great if you could have a look at this and check that I did not do something stupid somewhere

I also have a few open questions:

* theoretically all these functions could be static, should I change it to make the whole class and all calls to it static? (not sure if my mock object would work then)
* I'm not so happy with how the COMMON_NOTIFY_ADDRESSLIST event works, @HakanS do we know any plugin using that event? Should I change it as outlined in the todo comment?
* this currently allows nested subscriptions. Eg. I can subscribe the * namespace and the wiki:* namespace. that doesn't really make sense. should we catch that (I think the original code might have)