Move requires into function to make load errors only affect function
Move requires into function to make load errors only affect function

Only fail the function itself if for example rest_client can't be
loaded.

Closes #2

natemccurdy/puppet-puppetdbquery,redhat-cip/puppet-puppetdbquery,pyther/puppet-puppetdbquery,MelanieGault/puppet-puppetdbquery,gwdg/puppet-puppetdbquery,baptistejammet/puppet-puppetdbquery,gcmalloc/puppet-puppetdbquery,unki/puppet-puppetdbquery,ccin2p3/puppet-puppetdbquery,dalen/puppet-puppetdbquery,danieldreier/puppet-puppetdbquery