Add generics and change serializer semantics so a serializer is for a
specific class only