Final debugging for typechecking error handling, tidied up some error messages and added test file for typechecker error messages and recovery.