Pulled common character test functions into base lexer.

Moved is_alpha(), is_digit(), is_identifier() and is_identifier_start()
out of sitedef and template lexers into base lexer.