Stop all jQuery animations before taking snapshots

Setting `$.fx.off` prevents future animations from happening, but has
no effect on animations that are happening when it is set. To make sure
that all of these animations are in their final resting places, I added
a bit of jQuery that stops all animations on all elements, clears their
animation queues, and jumps to the ends of all of these animations. This
will help our snapshots be more consistent.

While I was at it, I adjusted the guards on `$` and `$.fx` to simply
check for the existence of jQuery. This should be good enough. I also
switched our usage of `$` to `jQuery`, since `$` may be defined as
something other than jQuery on some sites, while `jQuery` is likely only
going to be jQuery.

Change-Id: I77122c0db8be5f0985460e4717201d055a6410c8
Cascade-delete sweeps on project deletion

To prevent dangling sweeps from causing issues, I'm adding a
cascade-delete on sweeps when a project is removed.
Cascade-delete viewports on project deletion

To prevent dangling viewports from causing issues, I'm adding a
cascade-delete on them when a project is removed.
Cascade-delete urls on project deletion

To prevent dangling urls from causing issues, I'm adding a
cascade-delete on them when a project is removed.
Cascade-delete snapshots on url deletion

To prevent dangling snapshots from causing issues, I'm adding a
cascade-delete on them when a url is removed.
Cascade-delete snapshot diffs on snapshot deletion

To prevent dangling snapshot diffs from causing issues, I'm adding a
cascade-delete on them when a snapshot is removed.
Cascade-delete diff clusters on snapshot diff deletion

To prevent dangling diff clusters from causing issues, I'm adding a
cascade-delete on them when a snapshot diff is removed.
Add cleanup script to remove orphans

I've just pushed a batch of commits that make sure that we
cascade-delete things. Up until that point however, we weren't doing a
good job of keeping orphans out of the database. In order to help people
get their database in mint condition, I'm adding a script to clean out
any orphans.

To run the script:

```bash
be rails runner 'DBCleanup.destroy_all_orphans!'
```

Actually, that's not the way. By default, the script will do a dry-run,
and simply log what would have been deleted. To actually delete things,
you need to pass in `dryrun: false`

```bash
be rails runner 'DBCleanup.destroy_all_orphans!(dryrun: false)'
```
Add keyboard shortcuts to jump to top or bottom of page.

Fixes #79.

Following the conventions of Vim, 'G' jumps to the bottom of the page
and moves the 'focus' to the last focusable element.
The 'g-g' command jumps to the top of the page, moving the 'focus' to
the first focusable element.

The new shortcuts appear in the 'help modal' with explanations.

Also takes the liberty of alphabetizing the shortcut callbacks.

Issues:
 * It would be nice to pull the keyboard shortcut binding out into a
 library, so one could just pass a hash of shortcuts and handlers into
 one method that sets up the right listeners.  Something like this:
 `shortcutsBind({
   '?':  openHelpModal,
   'G':  focusLastFocusable,
   'gg': focusFirstFocusable,
   ...
  })
 `
 * Rewrote the `moveFocus` method to handle jumping to first or last
 focusable as well as moving focus forward or backward.  Maybe should
 further decompose into other methods.

Next Steps:
 * Write specs for this (feature specs?)
 * Add code for the 'gi' shortcut handler.
Remove empty 'gi' handler; make code work for different prefixes.

The prefix is now set based on the `event.which` number, and is
used in a conditional in the `handlePrefixShortcuts` method to
determine which shortcuts are called by that particular prefix.

This would allow for easily handling other prefix keys, by adding
more conditions or a case statement in the `handlePrefixShortcuts`
method.

Also removed the empty handler for the 'gi' shortcut, since that
isn't being used yet.
Move `event.preventDefault()` out of helper method.

The `event.prevendDefault()` was being called twice in the helper
method `handlePrefixedShortcuts`, and was using a closure to access
the `event` variable.  It makes more sense to prevent the default
behavior of the event earlier, in the place where
`handlePrefixedShortcuts` is called.
Tidy up comments; fix typos and style.

Fixes a capitalization error, adds hanging indentation, and fixes
typo in declaring DataType.
Rename 'gg' and 'G' handlers for clarity.

The methods were named to follow the pattern of other methods in this
file; `focusFirstFocusable`, but since they both also cause scrolling
they were renamed to describe both moving focus and scrolling;
`scrollAndFocusTop`.
Refactor the initial setting of focus and set it with 'j' and 'gg'.

The `moveFocus` method is now doing one of four types of movements,
so it shouldn't also be tasked with placing the initial focus if
there is no `focused` element yet.

This commit adds a helper method and calls it if focus is not placed yet
for either the 'j' or 'gg' shortcuts.

Issues:
 * Before each movement shortcut, we want to set the focus if it hasn't
 already been set.  The helper method to do this can be called as the
 optional first step inside of `moveFocus` rather than calling it every
 time that `moveFocus` fails.
Refactors the setting of focus when no focus is set.

When using keyboard shortcuts, the focus should be set the first time
a movement keyboard shortcut is used.  For example, 'G' should both
scroll to the bottom and set the focus on the last element if no focus
had been set already.

Since checking and setting the focus is a prerequisite for any movement,
this commit adds a helper method to get/set the focus and uses the
helper method at the start of the `moveFocus` method.
Move magic numbers into variables and make consistent.

The ms times passed for the scrolling and setting timeout for
prefixed keyboard shortcuts were hard-coded in.  Better to have
those at the top for consistency and easy configuration.
Clean up style and put 'gg' and 'G' near 'j' and 'k' in modal.

Style fixes:
 * spaces inside of `{}`s
 * add missing space after comma
 * chain var assignment and align `=`

Also changes order of shortcuts in help modal to make more sense.
Merge pull request #95 from flarnie/feature/keyboard_shortcuts

Add keyboard shortcuts to jump to top or bottom of page.