Add string escapes test
Reorganize lexer code for string escape sequences

Improve readability by moving code for escape characters in a separate
function.

Change the code flow to be more natural and fix a couple of potential
errors with quote marks escapes.