Handle task status updates

There's some refactoring in here to clean up main/taskstore. I also added a simple endpoint that lists active tasks.

The main thrust is that main now updates tasks in the task store, and the task store will remove them when they're terminal. It should probably maintain two stores: one for active and one for completed, but that's for the future.