Moved files to lib folder
Attempt to add promise compliance. Untested.