refactor some details to be able to do smoke testing as non-root user

This removes some code duplication and makes it possible to quickly test new plugins:
```
mkdir /tmp/collectd
FACTER_osfamily=Smoke/Test puppet apply tests/plugins/df.pp
```