Automatically detect console width

This can now be overridden with the :consolewidth command at the REPL or
in an init script. There is an optional dependency on curses - enable with the curses flag.