Fix ReduceByKey general algorithm to work with parallel ScanInclusive. Use bit representation for states.