code: function writeObject(elem) {
          var writer = new Core.Writer();
          elem.save(writer);
          var data = JSON.stringify(writer.current, null, "\t");
          return data;
      }
docs: Encode a given element to JSON data.
  @private
  @param {Core.Element} elem Element to be encoded
  @return {string} JSON-encoded data.