Add middleware for transactions.
Move DT_FORMAT global to settings file.
Add commit_on_success for ajax update.

Had to add a manual rollback for m2m errors though as the
commit_on_success didn't seem to handle it.