smarter split

Ignores empty lines as well as some whitespace