Initial commit of javascript implementation