added tests and npm packaging