Split lines rather than just validate them

Avoids "look before you leap" behaviour, as recommended by <http://eli.thegreenplace.net/2008/08/21/robust-exception-handling/>.