Fix for #1263 and #1165: Self-referring local class with default iterator value

Do a pre-pass on every block to register local classes. Java seems to limit local classes to be in blocks
anyways, and can't appear in non-block if/while/for statements for example so we should be good. That and
I also do LetExpr which is a sort of Block without being one.
Tests for #1263: Self-referring local class with default iterator value