Refactoring and additions 

* Refactoring
* Adding Sync capabilites
* Adding test cases
* Updating readme