Add some abstract classes

Add abstract classes for (de)serialization for all (de)serializers to
extend from.
Move some functions around for serialization
Bug fix for LuaDeserializer