Changed code style (indents, etc.)
Introduced an auxiliary class to trace scope enters/exits
Documentation update, still there's work to do