Some cleanup and better input for the buildmessage program