CodeBlockNode fix and some code refactoring

What was wrong with code block node:
Empty code block node should be deleted when it loose the focus - the same behavior is implemented in the Dynamo. So it had been done a code block gets the focus right after its creating. But it doesn't take into account the case when a code block node is being loaded with other nodes. In this case code block shouldn't get the focus - this fix is in this PR.
Also this PR contains some code refactoring

if node has a geometry ask the Dynamo for it
else clear node geometry (node may be graphic but failed for some reasons and therefore it has no geometry anymore)
This code had to be in Geometry PR