Ensuring the return of the default and some small refactoring

Catching a broad except to ensure the default return(#9), added tox, fixed some py3 compatibility issues, added some tests, cleaned up a bit(flake8), small refactoring