Combine fixes from forks, and make installable in recent Emacsen

Hey Phil,

This PR combines fixes and enhancements from @joodie, @rubbish, @bdionne and myself.

In particular, the `Package-Requires` header listed `javascript` as a dependency prior to these commits, but no such package is currently available. These days we can just use `js.el`.

Tested successfully (if cursorily) on the latest CouchDB.

Keen to get this into MELPA once merged. :-)

-Steve