Added Serialize/Deserialize functions

Now the library hides the implementation logic of serializing and
deserializing an object.

Added 4 methods:
- 2 for serialization
- 2 for deserialization