Better whitespace trimming (autocrop)

Fixes #241