Add conditional to organization edit/login links

We don't want to show the edit button to users that aren't logged in.
Conversely we don't want to show the login button to users that are
already logged in.
Extract shared person edit logic into shared view

This view can be used for both the person and the organization editing
view so the logic isn't duplicated between these two very similar pages.