fixed a performance bug in matching

 Using links or other "non-simple" variables in the score expression made things a lot slower than necessary because the "system temporary variables" kept accumulating and context_subset was increasingly costly.
(cherry picked from commit b0aaa1e)
added notes & links to issue 128
(cherry picked from commit 04dff9b)
added one more h5 tool: idshrinker

It renumbers ids starting from 0, and keeps all the links synchronized. There is also a small bit to change all 0 to -1 in link fields.