use pooling api

Cherry-picked from the master version of this. Had to delete the solaris
and windows configurations, which are not present on this branch.
use configurable gem source
Use the same kind of gem source switching as Puppet
Merge branch 'maint/stable/use-consistent-testing-setup' into stable

* maint/stable/use-consistent-testing-setup:
  Use the same kind of gem source switching as Puppet
  use configurable gem source
  use pooling api

This was a cherry-pick of commits
f01ba252a58b4f9628e658ea8a4c56c2ed68be53,
979adf36a6312e91ee0adb30196a64bfc32808c5, and
e35b2ea519cfe731bab6b00110ddced1af53ab49 from master