Simplify and package for npm.