Unit test + AMD

1. Use RequireJS for AMD
2. Added unit test cases
3. Commented timing code