Fix #35: Tests Refactoring - Add unit tests

I've done some improvements on python3 compatibility as well, but the tests are still failing on that part and there needs to be some more work done on the lib itself. Maybe that should be another issue/pull request altogether.

I've rebased from the current master.