:internal: add a parent pointer to be able to traverse the tree upwards. Add also a base class for container types.