Fixes global var bug.
Fixes another bug with global var.
Fixes bug in event dispatching.
Improves event handling.
Adds extra block 'log', and does base styling.