added simple exception output function to logger
reorganized and fixed up MainForm code