Serialization framework for scala