Added encoding and decoding

This allows for comments to be stored in the same way as they are stored in ArcGIS Online in addition to allowing "wholesale" decoding to prevent malicious javascript from being entered.