[FOLD] Begin logic to handle self-crossings (RIPD-665)
[FOLD] More work on this. Untested.