Added the ability to remove users, exposing this through web-services.

This required changes to profile serialisation, bringing marshalling
into the API, and the email system has been adjusted to avoid blocking
on email send (should always be a background action). Certain template
actions have been moved out of the web packages into the api packages.