rest-gen JS: allow custom HTTP headers
rest-gen JS: use Q promises
Merge pull request #51 from mbrock/q

Use Q promises