A big set of unsorted changes.

At this point almost all functionality is implemented. I have to finish
the notification service.