Started implementing redirection and option parsing. Fixed warning about old-fashioned function declaration.