Close first module tree entry when a node from a different sub tree is selected.
Fix several differences in handling white space compared to DDOC and add unit tests.