adding devDependencies and wiring up `npm test`
adding AMD support and fixing the potential modification to `Array`