Added support for the --threshold-count parameter

This parameter ensures only the top N matches are kept, as supposed to every
match beating a certain threshold.  This reduces the demand for tuning
parameters.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Use color output only when output is a tty

Color escape codes are not generally useful in data files.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>