Added comments and reshuffled code. General cleanup. Non error popups.
This change makes the behaviour of error logging consistent with other
engines by simply writing to the log and not popping up a modal dialog.