build from common base

Main file runs in browser unaltered. When called via Node, includes
node-compat.js, via index.js, to replace the prototype for the POST and
assign it to REST.prototype.then