Added avg. error to window-output, code cleanup, optional listener for published messages