some cleanup and documentation
v0.1.1 -- trimEnd seems to work (not systematically tested)