filter can now be used as a replacement to toJSON()

Removed the dependence on the models `toJSON` function, allowing it to be used inside a user defined `toJSON()` method or as a total replacement