Fixes behavior of AMD dependencies.

- Switches to Simplified CommonJS AMD syntax which allows code reuse
  with Node.
- Adds define call to each module.