simplify encoding splitter and support whitespace inside encoded

@bf4 @jeremy @mikel 

also some performance/GC improvements
`#flatten` should no longer be needed.