Fixes behavior of AMD dependencies.

- Switches to Simplified CommonJS AMD syntax which allows code reuse
  with Node.
- Adds define call to each module.
Merge pull request #462 from tbranyen/fix-amd-dependencies

Fixes behavior of AMD dependencies.