removed promises, changed to lib folder, added more unit tests