switching over to simpler event model, with program driven by main.cpp
merge commit