Changed the typechecker so it doesn't throw exceptions but appends errors to an error list.
Modified tests so they also use the error list instead of exceptions.