prevent errors when listing broken memberships

If the other side of the membership has been deleted then skip over
listing the details to prevent errors.
we need to leave the li in place as otherwise the code that attaches
edit events to this, which currently doesn't know about the contents of
memberships, relies on them being there to assign id data correctly.

Fixes #405
correct image deletion post url

the POST action URL used on the image deletion form was incorrect
which meant images could not be deleted. Fix this by adding an image url
generating function rather than coding them by hand in the template.

Fixes #407 and #412
remove old person adding code

This should have been removed before. It worked fine on dev, however on
production the JS compilation directly included the new person template
which uses the render method. As the _ extension that supports this isn't
included in the front end build this then caused a JS error which then
stopped the correct new person event firing.

Also fix broken cancel link on new person page

Fixes #440
Custom query support for autocomplete model

This lets you provide a third parameter to 'autocomplete_model' which
can asynchronously return a query object. This will allow us to restrict
the list of auto-completed to include only those that are relevant to
the currently selected post.
Pass selected post's id when autocompleting orgs

This will allow us to filter the list of organization returned to only
include ones that are appropriate for the selected post.
Add custom query for organization auto-complete

Only auto-complete organization which are relevant to the currently
selected post.
Merge branch '418-restrict-posts-listing'
Update popit-api to latest master

This includes the latest code for retrieving a full record without
processing the translations.