Fix inserting QuadTree elements to proper nodes.
Changed the way node index is determined.

It's now calculated from the location bits (instead of if-else chain). In consequence the order of
nodes no longer looks like 'U' shape but more like 'reverse N'.