Allow the consumer DSL to be used from code running in a node context (rather than browser)

This required a couple of changes:
- Fixed incorrect package.json 'main' property.
- Added module export.
- Added lazy dependency on xmlhttprequest module (allows access to XHR object from node code)