Cleanup in util.py and node_s

socket data cache is now per node tree
partial update cache implemented

Removed much unused code, some moved around, some comments etc.