broken toJSON fixed, collection tests pass