Limit max events

Prior to this PR, the JS client code pulls all events in `[lastEventId, current]` from the server, but enforces a client-side maxEvents parameter to only process `[maxEventId, maxEventId + maxEvents]` of the received data. 

This is rather wasteful for large jobs with many events, this PR pushes the logic to limit maxEvents to the server. The client passes maxEvents as a query param to the GET call, and simply processes any events it receives.