Refactored as a class
Merge pull request #1 from waskosky/master

Refactored as a class.  Thanks @waskosky!