Added tests for export command.

Also fixed a minor bug in exporting which my tests caught.
All of the currently implemented commands are now tested.
Tests now run with 'setup.py test'

Also included the test requirement of the Mock lib. You can still
run 'python -m unititest discover', but 'python -q setup.py test'
is better as it will load mock if it is missing. Remove '-q' (quiet)
flag for verbose output.