Removed dependency on 'tr'

And made the sed expressions more widely compatible. ('s/(^\s*|\s*$)//' appears not to work on my OSX10.8 machine)
Removed old testing code.

Seems we were checking a fictitious variable for valid characters instead of the title we're supposed to be checking.
Made example syntax more proper.
Changed formatting on invalid key report
Added CutSpaces example & test.

This demonstrates a fix since moving away from using tr. Also fixed a typo.