Re-rendering components into a document leaks components

This PR request does three things:

* provides test cases which 
  * test if we are able to unmount a component mounted into a document.
  * test if we can get reference to a component mounted into a document.
* fixes unmounting such components from document element
* fixes if such components can be queried by its container element

Merge test cases only, make sure they are sane, make sure they fail without further commits, then merge the rest and see everything is green.