cli: Move main loop out of lexer file