Refactored resources chopping logic in allocator.
Refactored resources chopping logic in allocator.

Introduced a `shrinkResources()` lambda in allocator
so that the same resource chopping logic can be re-used
in the future, in particular, when introducing the quota
limit.

Review: https://reviews.apache.org/r/66044/

Gilbert88/mesos,chhsia0/mesos,dforsyth/mesos,asamerh4/mesos,andschwa/mesos,andschwa/mesos,gsantovena/mesos,kaysoky/mesos,jpeach/mesos,dforsyth/mesos,dforsyth/mesos,abudnik/mesos,reneploetz/mesos,jpeach/mesos,chhsia0/mesos,andschwa/mesos,kaysoky/mesos,abudnik/mesos,reneploetz/mesos,dforsyth/mesos,gsantovena/mesos,asamerh4/mesos,chhsia0/mesos,gsantovena/mesos,andschwa/mesos,kaysoky/mesos,abudnik/mesos,asamerh4/mesos,gsantovena/mesos,kaysoky/mesos,jpeach/mesos,Gilbert88/mesos,asamerh4/mesos,andschwa/mesos,chhsia0/mesos,dforsyth/mesos,reneploetz/mesos,andschwa/mesos,Gilbert88/mesos,Gilbert88/mesos,asamerh4/mesos,gsantovena/mesos,gsantovena/mesos,kaysoky/mesos,chhsia0/mesos,dforsyth/mesos,kaysoky/mesos,Gilbert88/mesos,reneploetz/mesos,jpeach/mesos,jpeach/mesos,Gilbert88/mesos,abudnik/mesos,abudnik/mesos,dforsyth/mesos,kaysoky/mesos,chhsia0/mesos,chhsia0/mesos,abudnik/mesos,abudnik/mesos,reneploetz/mesos,asamerh4/mesos,asamerh4/mesos,reneploetz/mesos,reneploetz/mesos,jpeach/mesos,Gilbert88/mesos,gsantovena/mesos,jpeach/mesos,andschwa/mesos