A serialization framework for Moose classes