Switch the mailers to be invoked using ids, not model objects. This makes it easier to support asynchronous mail jobs, as only simple ids need to be persisted.

Fixes #2808
Better factory integration for extensions.

Related to #2780
Update extension README, detailing new factories integration.

Related to #2780