Refactor and fix duration priority boosts

This commits refactors the utility methods for calculating priority
duration boosts to make them testable completely in isolation of
Jenkins.

Also adds an initial set of tests for boost calculations