simplify multithreaded inversion counter, add tests