Remove whitespace at end of lines
Add script for removing trailing whitespace

This solution was suggested by @akaihola, and it is from a gist by
@dpaluy.  Originally from stack exchange (see the script for a link to
the gist and the discussion).

Closes #408.