First experimental support for events
Fixed a couple of bug. Thank you, unittests
Added some basic tests for events
Completed implementation of 'NEW_INSTANCE' events
When clearing knowledge base, also clear registered events
Added tests for 'polled events'

'polled events' have no callback associated. The user must manually
poll KB.events. Useful to better control the execution flow.