Added toJSON() method to collection and model, tests.