refactoring some library methods
migrating tests over to mocha and travis