Run a trim on the title before setting the title attribute on the button

Fixes problems with strangely formatted title boxes.
Merge pull request #1 from mojotech/bae/trim_extra_spaces

Run a trim on the title before setting the title attribute on the button