Moved out commandline option parsing.