Better support for module loading.

We now support AMD, require.js, node.js and direct <script> tags.