Require CGI

Specs pass without the explicit require, but actually using it fails.
Output stderr, not stdout in the case of process errors
Add /slacklog command to print history into current buffer

- Factors out output_history to be shared between the buffer_opened and
  command callbacks.