fix Various: Create simple internal common message formatting

The JSON check would fail it JSON were undefined. Though I don't see why we even
need that, since its implemented in all supported browsers anyway.