Location fixes

Node location was previously pretty stupid, doing stuff like always leaving the first element even if that made no sense. Now each element is evaluated in the context of its neighbors which does a much better job of removing stragglers.

Still probably won't handle multiple blocks belonging to the same root domain separated by repeated chunks of other stuff, but that's an issue for another day.