Updated environment parsing to convert sequences.

When parens or square brackets are found in a string, convert the string
into a sequence.
Updated CSRF token management.

Updated the ajax setup function and added JS file to base template.