Added inital tests.

Most things are now tested. Still have the export command to do.
Also have a few issues to work out with a few tests. While all
tests pass, a few commented out lines are not passing yet.
Not sure if it is me not using Mock correctly or badly constructed tests.
Either way, outside of the testing environment it all seems to work.

Note that the tests require the 'Mock' library to run. Otherwise
using standard unittest framework. Just run `python -m unittest discover`.