Add observeEvent and eventFilter functions for handling events

@wch What do you think of the names?

Note: Still needs to be documented (both help and tutorial).