More work on testing.

- Clean up and annotate error tests.
- Start on some simple semantic tests.
Along the way:
- Add custom compile error output.
- Fix recursion for generic function values.
- Fix logic involving PHI nodes with branches in the middle.