Added some tests. Fixed some problems with transitions. Rewrote the app
so that it uses the API instead of relying on the information in the
webhook.