Support for remote puppetdb

This PR contains changes that were required to handle connection validation in a more flexible way. The new solution also allows (on demand, not by default) to store configuration settings even when puppetdb is not reachable.