Restructure to a npm package
Fix bugs on unit test cases