safer JSON encoding of $.User