Refactored error handling

* Added py.test options to unit tests
* Added check for weak passwords
* Added check for signature
* Changed error handling