Use `Try` for error handling.

Replaced usages of `Either[String, T]` with `Try[T]`. A special
ErrorMessageException was added to generate simple messages using `Try`.