Converted javascript into an AMD module.
Merge pull request #8 from juho-jaakkola/amd_module

Converted javascript into an AMD module.