toJSON accepts replacer and spaces