Code Cleanup & Gem fixes

Prior to this commit I had quite a bit of code sitting in some of
these classes, in this commit I started cleaning the code up.
I also fixed the gem install fixes related to the gem provider and
this bug https://projects.puppetlabs.com/issues/19741