fix parser bugs, and implement statement-based type checking
fix parser bugs, and implement statement-based type checking

Nathan-Fenner/Bismuth,Nathan-Fenner/Bismuth,Nathan-Fenner/Bismuth,Nathan-Fenner/Bismuth