Basically copying what I have from my capabilities prototype

Signed-off-by: Luke Kanies <luke@puppetlabs.com>