Can now override toJson by implementing serialize. Used by collections