global var cleanup. misc fixes.
implement some demo functions
add ctrl-c handler to serialEvent