Improve the LID parser and lexer.

This fixes a bug when there were extra CRLF at the end of a file.
It makes this work pretty much the same as the Dylan file header
parsing and lexing.