Allow JSON attributes to be customized

Addresses #1058.

The default values are backward compatible. But I think that in the future, they should be changed to things like `__id__` to reduce the chance of conflict with user data.