Major FIX: Add queue to store previous parents

this allows to properly determine node to which current node should be
connected after adding leaf node to the network, and resolves problem
with nested branches
Clean up code from junk comments

fix indentation
Evaluate method connecting nodes for proper order

getting rid of these fixmes