Add a basic test case for git send-email, and fix some real bugs discovered.