Strip off trailing \n in submissions. Fixes #411.

@rubysolo Would you mind sanity-checking this? I'm terrified that I've missed some important detail and will end up mangling the code people submit.