Tests: enabled running doc examples using test() function

Also

* auto clean up the connections even after Ctrl-c interruption
* improved tests/README
* added generic.cv examples to tests
* improved onUnload disconnection a bit