Overhauls handling of STDIN.