Added specific exceptions and added the validateSignature() method, which is much more compatible with the Python and JavaScript libraries.
Styling
Remove unused code.