[agent] refactor serializeEvents

Lets only expose `serializeEvents` cause that's all we'll use...