Improve handling of CSRF errors, and generate new tokens on form submission (so you can submit the form again after an AJAX request) - small tidy up to AJAX behaviour (I want to refactor the JS code for AJAX too).
Convert all spaces to tabs (sorry Jonathan)
Merge with upstream