Refactor and clean up error reporting

Use proper ErrorListener interface