Move the parsing of each <primitive> to a method
Simplify the parsing of <primitive> elements

The previous implementation had a lot of duplication of expressions, and
pointless creation of nested hashes with only one element only to later unpack
them with slightly different keys.
Eliminate repeated code to parse <nvpair>s
Merge remote-tracking branch 'remotes/origin/3394_utilization'