Fix 'enter' in autocomplete fields (djblets)

Handling of the 'enter' key for autocomplete fields like people and groups
wasn't correct, because the djblets handler (which submits the field) was
running before the autocomplete handler (which populates the field with the
current selected item).

The fix is to ensure that the keydown handlers run in the other order. This
change does the djblets side of that, adding a 'deferEventSetup' option.

Testing done:
Reproduced the bug. After this fix (and the matching reviewboard one), I can
press "enter" with a selected user and it will properly populate the field.

Fixes bug 2779.

Reviewed at https://reviews.reviewboard.org/r/5282/
Allow subclasses of RootResource to provide additional data.

RootResource no longer hard-codes the structure of the resource data.
Subclasses can now override serialize_root() to provide additional data.

In order to allow caching to work correctly with custom data, we now use
a repr() of the data instead of assuming certain contents when
generating the SHA1 for the ETag.