* Network: Fixes sorting on Layout sorting, refactoring.
Fix for #3403
Chromium has divergent behaviour on sorting of `undefined` values, a check has been added for these.
The fix itself is small, it adds a check on `undefined` in the sorting function(s).
In addition:
- Fixed off-by-one error on tree index
- Refactored away checks on visibility by replacing `_isVisible()` with a Strategy pattern for direction
The latter removes a long-standing eyesore in `LayoutManager`; it's probably also faster.
There is some hope that these fixes will improve the hierarchical layout initialization, which has had
problems for quite a while.
* reformat code block
* Add next attempt to fix Travis unit test bug
* Fix unit test - timeout
* Adjustments for comment reviews
* Moved direction strategies to separate module; added fix for 'window is undefined'