make Model to use the new Database API + all tests pass + better toJSONObject()