[Extensions] Add support for persistent callback listener

This is going to be the base of the EventTarget implementation. It is
important to remove the listener at some point otherwise the object will
leak.
[Extensions] Add browsertests for the persistent callback listener

The test implements a heartbeat which works in a similar way of an EventTarget.
The callback is set only one and gets called multiple times.
Merge pull request #1038 from tmpsantos/persistent_callback

[Extensions] Support for persistent callback