Button handler/Tab cleanup

Grab this code and see if it can drop-in replace this script for you.  I think it should.

I cleaned up some tabs for you.  You had 4 spaces equaling a tab...but that isn't quite right.  \s\s\s\s and \t are not the same thing.

button_handler(option) should be cleaner than an individual function for each button.