Fixed: mistake in BAT.Base.match checking TTCs

Mixed up order of relative velocities and TTCs.
That was the reason why TTC matching didn't work.
(Actually it was outcommented for the last time.)
It works fine now.
Generalized C LRU cache using macros.

Less copy and paste of C code.