Begin implementation of the custom event handler system
Make various whitespace improvements