Move javascript out of AJAXed parts.

Ivan N. pointed out that for AJAX-loaded parts, the Javascript content might not get through / get correctly used.

For me, clicking on the green "Add external user group" did not open the form.