Added a 'trim whitespace' command and trigger it on save if enabled. Fixes #151