Fleshing out main loop and on/off code

copied from another exhibit in OSC - clean up still to do. Also added
the asterisk break sections that I like.