Fixed tests, added package.json and generally made library work