Update for new exception syntax.

Python 2.6+ introduced a new syntax for catching exceptions with the exception
value. Instead of `except Exception, e`, it's now `except Exception as e`,
which is really much nicer. Since we're 2.6+ only now, we can convert to this.

Testing done: Ran unit tests.
Reviewed at https://reviews.reviewboard.org/r/4875/
Allow inlineEditor dirty field calculation to be overridden.

The current dirty field calculation in inlineEditor is fine when dealing
with textareas, which have no concept of dirty state to begin with, but
custom text fields may be smarter than that. In those cases, we want
callers to be able to compute a dirty state on their own.

Now, options.isFieldDirty can be provided to return whether or not an
editor is dirty. The default implementation compares text, as it's
always done.
Use DjangoJSONEncoder in the json_dumps template tag.

By using DjangoJSONEncoder, we can properly serialize a few extra types
that the default JSONEncoder does not handle the way that's typically
expected in a Django app, such as timestamps. This ensures that a
timestamp serialized using json_dumps will appear the same as a
timestamp serialized through a WebAPIResource.