Add utility functions for calculating build health based priority boosts

This commit adds additional utility functions which can be used to compute
priority boosts based on the health of a build.  This includes a number
of unit tests covering this.
Cap duration boost to range 0.25 to 4.0

This commit modifies the priority boost calculation for durations so
that it is capped to the range 0.25 to 4.0

This is done so that builds can't get overly boosted e.g. a fast
build always shooting straight to the front of the build queue or a
slow build always languishing at the end of the build queue.

Adds additional unit tests to cover these cases