Paralleling the tostring to have a symmetric tojson implementation