More changes to make multiple clients work. Test case for ongoing events at least works.

Reimplemented action parameter to indicate which client.

Moved more stuff from the form into the session scope.