Implemented some unit tests. Tweaked GUI and refactored code.

We haven't discussed the API for this, have we? As in, how to check if there's an upcoming deadline or stuff.