Introduce validate_proto / stop stripping spaces

The code to do warnings on invalid prototypes was a chunk
of 70 or so lines inside the core lexer.  It also had the
side effect of removing spaces from the prototype as part
of its check for warnings.

This validation code is now just a validation, printing
out warnings if and only if warnings are enabled,
and leaving the source SV untouched.