Replaces all identifiers with their definitions before type-checking. Enables more type-checking, but *realllly* slows down type-checking. Also a test case.