(SERVER-68) Fix gem cli script bug
Merge pull request #223 from dankreek/SERVER-68/fix-gem-cli-script-bug

(SERVER-68) Fix gem cli script bug
(MAINT) Minor presuite cleanup.

* Temporary file should use 'puppetserver' instead of 'puppetdb' in its name.
* Restructure code so it's a little easier to read.

Signed-off-by: Wayne <wayne@puppetlabs.com>
(PUP-3459) Reports dierctory created with wrong owner.

This is a workaround for a more general problem with the puppety approach to
creating application-level resources--creation of directories whose paths are
known in advance is an installation task, not a runtime task.

Signed-off-by: Wayne <wayne@puppetlabs.com>