Add the beginnings of a test suite.

Summary:
I just do a simple test at the moment; there will be more to come.
And it's not pretty how it mocks things out and then never un-mocks
them.  It could do that better too.  (If only 'mock' were part of
python 2.7...)

This already found a few bugs that I've cleaned up as part of this change.

Test Plan: tests/alertlib_test.py

Reviewers: chris

Reviewed By: chris

Differential Revision: http://phabricator.khanacademy.org/D8620