Add option to use color codes in non-tty contexts

This adds the `--color=<when>` option to the command to specify when the output should be colorized, where `<when>` is either `auto`, `always` or `never`.

Fixes #325.
Sorry, I'm not at all familiar with the code base, I wouldn't know where to start with this. Any hints?