Make ConnectedNodes direction-agnostic + tests.

Line segments should really be considered equal if their endpoints are
equal. The property that they are not sucks really hard... AAAAAAAH
More tests, just in case.
MultipleCurves: MST -> custom

TODO: Explain in more detail what I did. It'd be better to not do that at 4:30 AM.
TODO: Include angles in the calculation of tryReplaceSegment
TODO: Remove the two unused methods at the end if they end up unused.
TODO: Put running time analysis in it.
Find other tail of nodes for open curves
Check whether two new segments intersect

Previous assumption that two new segments don't intersect was wrong.
MultiCurves: Update some comments

See my notes on paper for more details;
Most of the test cases look good. Most of the partially failing test
cases are caused by the following major TODOs (in order of priority):

- maxlen
- one
- magic

"maxlen" must be applied at all stages. It puts a limit on the maximum
length of a segment. Preferably it accounts for local changes, such
as the average segment length in the current shape.
Statistics may help with implementing the latter part correctly.

"one" is just checking all nodes with one endpoint. An idea is to
first find all of these nodes, then try to connect them if possible
(with custom replace decision logic if needed).

"magic" is needed to solve some difficult problems. E.g. the
multiCloseCurves test case fails because of the proximity of the nodes
at the center. This could be solved by accounting for the direction of
a path. Similar for multiEnclosedShapes.