view.py: also check for balanced brackets and braces
view.py: check that root node $$ is not a directed dependent