* Code cleanup.
* Better error handling.
* Better locking (as much as possible with us being a module).
* Added unit tester (unit_test.py)