Bug fix

Fixed a bug in doScript
Made the programmer mode window an internal frame
Reorganized some code