[mypyc] Refactor: extract IR generation for expressions from genops (#8428)
This follows the pattern established in recent refactoring PRs.
Also extract specializer code since it's used both by mypyc.genops
and mypyc.genexpr.
Work on mypyc/mypyc#714.