Refactor serializer API to provide for serializer factories.