Move expansion of 'assert' from renamer to typechecker

This improves error messages when there is a type error,
fixing Trac #9774