This is mostly cleanup from 4cd67004d removing Diff, which was the
original caller of the moved functions.
Change-Id: I015cb310527d9e7593e4ba6ac15ac204435d9ab4
This lets us encapsulate everything about a check in its JS definition,
which makes it much simpler for other extensions or gadgets to create
checks.
Change-Id: Ica23fc26a576d55addb001e4baf78b3702927208