add js file
update js with latest improvs
Add AMD exporting