fix fqdn lookup and add smartvar

Fix searching for fqdn when not called from the command line with mcollective
Refacter to move searching logic into functions
Add search for smartvars
Add required configuration options
Document configuration