ported fixes from web back to jsonml-stringify
work in progress migration