refactor(errors): move error calls and output to error class

This is the start of a better wrapper to handle errors. It also
prints error text to stderr instead of stdout.
This one is not used now, right? Could we remove it?
Lgtm then.