Standardize toJSON and related

I'll open an issue to make this be lazy initializated.