Refactored serialize method - now it returns string.
Fixed unit tests for serialization.
Refactored to use Serializer module.