Fix missing exception import and refactor tests
Merge pull request #39 from OpenPassword/feature/A-bit-of-refactoring

Fix missing exception import and refactor tests