Trie index: minor improvements
Main point: don't segfault when trying to use an ordered index that wasn't built, and instead rebuild it for that particular node whenever needed. More details in commit messages.
Note: over longer term I expect a different solution for tries, at which point this simple MR would become irrelevant.