Promote mapping for beginning and end of line

I use these mappings all the time, so I'm taking them out of the Learn
Vimscript the Hard Way section and placing them into the main part of
the file.
Trim trailing whitespace

This function can be called at any time to trim trailing whitespace. It
will also do so when saving a file.

I got it from http://www.bestofvim.com/tip/trailing-whitespace/.