moved dependencies back to lib folder. Added tests.