changed model API, +toJSON(), +reset(), -attributes. Modified set() to return a Stream; removed type annotations in method bodies, added more tests for the Model.