Added kryo serialization to the model, and a test.