[mlir][sparse] refactored codegen environment into its own file
Also, as a proof of concept, all functionality related to reductions
has been refactored into private fields and a clean public API. As a
result, some dead code was found as well. This approach also simplifies
asserting on a proper environment state for each call.
NOTE: making all other fields private and migrating more methods into
this new class is still TBD in yes another next revision!
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D140443