Hygiene: Make reference extraction more concrete

While reviewing the patch that added placeholder reference
handling I wasn't particularly thrilled with the code all
going into container.php.

Independant classes seems like the correct approach here since
we have two pieces of data, the XPath and the extraction routine,
which are inexorably linked, they only make sense as a pair.

Some minor refactors were also applied to make the code more direct,
the extraction methods now create the appropriate references themselves
rather than passing extra arrays around.

Additionally Reference types are now provided as constants instead of
directly in string form.

Change-Id: I8ae467dd2d2a7d3fac8dd33b42d2a7d087a63340