Change xal.start parameters

The first argument should be an object with name: agentName
Change parameters for on event callback

The updated state and next function are passed
Store agent state in agent object