Support for serialization listeners & serializer builder

Serialization listeners can be injected into the serialization handler
to enable pre-serialization transformations on entities. The factory
class is also extended to support easier construction of the serializer.