Refactor fetching v1 attributes from parent template tree.

Refs #5929
Dump Icinga 2 objects, part 1.

Refs #5929