Rework the metrics tasks. [ci:skip]

This dramatically shrinks the size of the bundle (though it requires
developers to manually install the gems for metrics creation), and
fixes Brakeman code checking.