add embed query to allow expansion of memberships

This adds an embed query parameter which are similar to django's
join specifiers and allows the expansion of the person or organisation
sections of the memberships of a person or organisation

e.g adding ?embed=membership.person to the end of a resource URL will expand all
the persons entries in the memberships of a resource.
?embed=person.organization will expand the persons entries and then the
organization entries within those.

If a blank embed is specified then no memberships are included in the
result. This is for use in situations where only the basic details of
the document are required and hence reduces bandwidth and processing.

If embed=membership is specified of the embed parameter is left off then
memberships are included but not expanded.
convert images array into an image url

this converts the image id in the images array into a url for popit
hosted images and also populates the image property with the url of the
first image in the images array for popolo spec compatability

Fixes #470
make sure images set over the API are displayed

At the moment the popit front end doesn't follow the same data model as
popolo for images so when you include and image URL over the API they
aren't displayed by the website. This does the required processing on
the uploads to fix that.

Fixes #432
test API handles image attributes correctly

make sure we create an images array from an image attribute and vice
versa