Improvement of test coverage

* Added test coverage for events/listeners
* Fixed a few copy and paste mistakes
* Changed the add_listener interface a bit
* Fixed a few missed lines with assertions