serialize model to file so that it can support jython.
Merge pull request #81 from piaolingxue/issue/80/jython_integration

serialize model to file so that it can support jython.