Added support for "sum" function for thresholds.

The existing code assumes the user wants an average value for their
thresholds.

This code adds a "-f" option (function) where the user can choose
between "average" and "sum".

It also adds a require for "rubygems", which was required on our RHEL 6 installation.