Stop membership view from 500ing

Stop membership view page from 500-ing when missing an organization or person. Also did a tiny bit of tidying just so the page doesn't look completely forgotten.

Fixes #657