Add unit tests for message batching

Ran grunt test