Lookup domain from the environment

Also lookup apps by UUID where possible.

Resolve bug https://bugzilla.redhat.com/show_bug.cgi?id=1092703
Merge pull request #29 from ironcladlou/lookup-fixes

Lookup domain from the environment