Standardized toJSON, fromJSON, toString and fromString interfaces

Oh sorry