Move translation phase 1 and 2 to file.c.

The C specification defines translation phases (C11 5.1.1.2).
The phase 1 and 2 are about character handling, and phase 3
is about tokenization.

We used to do some charcater processing in lex.c as well as
in file.c. There was no clear separation of phase 1, 2 and 3.

This patch moves all code for phase 1 and 2 to file.c.