Internal rewrites completed, new functions (partially for readability), testing on new benchmarks - currently no bug detected, but many rules haven't been tested yet (all marked with TODO)