More cleaning. Cleanup detectMode function.
Remove redundant code from OSD_Panels. A few more cleaning.