Separated JavaScript and CSS from HTML.

Also, merged ajaxerrors.js into utils.js and included utils.js in the base template.