Re #1164: Add hidden 'batch_id' value.
Fix session cookie handling -- no longer generate a new session per request.
Fix breakage due to changing variable scope.
Fix all buttons on single batch screen (fixes #1164 and #1163).