Added javascript function for templates and HttpRequestManager handling

Signed-off-by: Mike Mackintosh <mike.mackintosh@angrystatic.com>