Clean up some PyFlakes warnings in Djblets.

This cleans up a few small PyFlakes warnings in the Djblets code. These
warnings were harmless.

Reviewed at https://reviews.reviewboard.org/r/6068/
Clean up all Djblets JavaScript warnings and errors from jshint.

This goes through and cleans up all the warnings and errors that jshint
reported. Only one of these (an extra comma) would lead to page
breakages, but the rest should help with some optimization and code
size.

There were two changes made that were bigger than just using '===' or
similar.

datagrid.js has had its initialization code moved to the bottom of
$.datagrid, in order to define functions up-front (as jshint wanted)
instead of defining functions after being called. In practice, this
wouldn't cause any issues, though.

scrollIntoView() now caches $(window), $(document), and $(this) in order
to reduce execution time. I had to condense var statements there anyway,
so I just moved those out.

Reviewed at https://reviews.reviewboard.org/r/6055/