Initial implementation of serialization