IN PROGRESS - issue YZABP-26: CP - Goals pages 
https://illuminadev.co.uk/jira/browse/YZABP-26

Throw an actual exception if we can't talk to the far end
Handle the return value correctly if we do a re-try
Create an extension factory to allow the dynamic creation of specific
extensions based on the source value
Use this to initialise the extensions
Allow the extension element to be given a reference to the Proxy that
uses it (which will create a circular reference)
Add a hook (setThingPreExtension) to allow things to ensure that their
state is set up correctly prior to the extensions being initialised.
(This works around the fact that the extensions want to be set up on by
the BaseThing)
Utility method for retrieving a specific goal.
Fix synchronisation of goals.
Fix typo in variable name.
Account for the case where the value being set is NULL and the type is
an array that allows 0 entries.
Add new utility method "getValue" for dealing with valued types.
Handle the case where the thingElement is empty when setting up a
codableValue
Add in the missing elements for the person proxy, and the code to
update/retrieve from the thingElement
Fix check for empty data in getValue
Fix the contact code so it has access to the correct classes
Fix typos/wrong method calls.
Merge remote-tracking branch 'origin/pep'
Do not generate a backup for the Request.php modifications.
Add in the "replaceGoal" method for CarePlan
AccessDeniedException added.