Continued refactoring for loops

1) Introduce a virtual method on BlockStmt to support dead code elimination.
Current code relied on inline access to the blockInfo field.

2) Also some trivial code cleanup