Simplify update_minimal a bit more, by making id_index a
cached variable, which is updated on mutating operations
also use this to implement a faster id2path, and add direct tests
since id2path now uses a more complex implementation.