Clean up columns setting

Use hasattr to check whether or not columns was set on the command line
or in the configuration file. If it was not set to a valid value in
either of these places, set it to the width of the terminal, or to 80 if
the width cannot be determined.