Improvements to puppetdb and legacy handling

* Reduce execution of external commands in shell scripts
* Use /usr/libexec for suse, darwin and bsd also
* Make rake install task more DRY for puppetdb-legacy and sub-command copying

Signed-off-by: Ken Barber <ken@bob.sh>