Add new break scope algorithm, miscellaneous bugfixes
Fix type inference of returned values and fields