Added test for sendTextMessage, simplifications