mostly code cleanup, but also event stuff

Signed-off-by: William Rockwood <wrockwood@tadl.org>