Added custom events/callbacks. Split project into library and run script to demonstrate and test the event API.
Added canvas.clear() (press 'c') command. Some other improvements.