Fix issue with some browsers submitting scenarios with \r\n

And DRY things up while at it