Add isEmpty method to MessageBag. Closes #1579.