add AMD and CommonJS support
add tests
added umd support