A mixin for making serializable objects