Add toJSON function for converting circular structures to JSON; fix issue where the parse function of a model is not called when it is fetched
Move test case