began toJSON functions, and their tests