tools/reduce: various improvements to remove more code