Check if the session is active when submitting a record form.  If not, display the login form... and upon authentication resubmit the form

Refactor the login javascript so it can be used by both the navbar login form and the record form when sessions are lost

Add new modal template to allow for quick ajax modals to render any template partial it is assigned.

Upon reauthenticating, pass back the new CSRF token so we can poke it in the new form and continue.
Don't initialise the session check upon form submit when running the selenium tests
Fix broken AS.openAjaxModal refactor.. it wasn't adding HTML to the modal.. oops
Merge pull request #644 from hudmol/rescue-form-when-session-lost

[Delivers #53749855] Check if the session is active when submitting a record form