Moved most of the entity serialization to their own classes