Improve lexing of numeric literals and add tests.