Some improvements on the MessageBatcher and Initializer.

Also added a LambdaUtils class that provides a slightly cleaner way to
deal with Exceptions in lambda expressions.
Fixed merge conflicts.