Expanded message handling and some diagnostic API.