clean up sendmessage.php and add more test cases