Fix up and unify support for AMD and node.js

Don't touch console global
Export lib as node module, AMD module, and window global

I've tested this locally with node.js on both the standard and minified libraries.
The AMD loader test is here: https://demo.sites.team9000.net/tests/loader/require.html
The typical loader test is here: https://demo.sites.team9000.net/tests/loader/standard.html