lots of housekeeping

made the global variable names a little more consistent.  made different
sections for various methods that are alike.  Created a bunch of methods
for timer events. just a whole lot of code reorganization.