Change the NodeToId map from a singleton to a per TreeManager object

This is used to support loading multiple versions of the same project
project at the same time. These will contain many nodes with the same
ids.
Allow creating an 'if' by surrounding existing statements with if{ }
Enable loading of models from memory and not only directly from disk

UNTESTED!