code: function createForm() {
      return new Promise(function(resolve, reject) {
        var frm = {},
            fname,
            url;
        function returnForm() {
          delete res.url;
          delete res.userid;
          delete res.password;
          delete res.urlPrefix;
          Object.keys(res).forEach(function(itm) {
            frm[itm] = res[itm];
          });
          resolve(frm);
        }
  
        fname = res.urlPrefix + res.url;
        if (res.userid && res.password && fname.search('http') === 0) {
          url = URL.parse(fname);
          url.auth = res.userid + ':' + res.password;
          frm.url = URL.format(url);
          returnForm();
        } else {
          if (fname.search('http') === 0) {
            frm.url = fname;
            returnForm();
          } else {
            inline({fname: fname, cssUrlReplacer: cssUrlReplacer, inlineContent: inlineContent})
            .then(function(src) {
              //fs.writeFileSync('src.html', src, 'utf8');
              frm.src = src;
              returnForm();
            })
            .catch(function(boo) {
              reject(boo);
            });
          }
        }
      });
    }
docs: /* createForm makes the form to POST to Tenon.
  If userid and password are both present, incorporate them in the
  remote url. Otherwise, if the url parameter looks like a local file, inline
  its local javascript and css assets and make the resulting string the src
  parameter in the form.
  
  Inlining is an async process and this function returns a Promise.