Implemented unit tests and refactored script

Implemented unit tests with unittest and nose.  Resolves #1.

Rebuilt the script into a class so to better test methods.

Updated licence and some other minor config stuff.