Move deserializers to serializer.hpp and generalize

Generalized the structure of the deserializers, which should make it
possible to have a single typedef for both, serializing and
deserializing.
Implement some serializers
Re-rename deserializer tests
Fixes to serializers and test them using the old tests
More fixes and port of example to new serializers