ANSI-colored logging and prompt

This pull request adds ANSI colors, if the output terminal is a TTY. The *mailpile>* prompt is logged in bold-gray, and the log message color depends on the log level.