Support custom model class

/to @raymondfeng please review

Close #56.