Rename exceptions in nodes.py
Refactor logging system and its uses.

Make logging system more thread-safe.
Rename nodes.py to node.py
Further improve and refactor logging in node.py

Now there is no chance of mixing output from simultaneously running
child processes.
Also, significantly refactor builder.py.