Add npm test and fix Travis CI build