Allow easier control of Security templates with AJAX, etc.

#### AJAX friendly responses for Security class
Final work around issue #1802 - creating templates for complex layout
operations and removing HTML from this controller.

I've worked with @chillu's advice to get everything ready to merge in to master.