refactor to a gem and classes

Hi, i found your repo quite useful, and spent a little time refactoring some of the methods into classes and  also setup the project as a gem.    I thought the class structure might make it a little easeir to add functionality, such as 2 way sync.
thanks