Replaced error messages with Exceptions.

All previous error messages, printed to the user are now implemented as
Exceptions.