Catching a broad except to ensure the default return, added tox, fixed s...

...ome py3 compatibility issues, added some tests, cleaned up a bit(flake8), small refactoring