Code refactoring to move functionality from TypeChecker.cpp to ASaPUtil.cpp;
This functionality will also be used by the EffectConstraintGeneration pass.
Removing duplicate code (using factored out implementation).