Changed all MessageDialogs to use the new functions; improved comments; misc changes.