Add tests for new ToJSON accessor fix/functionality