Refactor the title and swap case tests.

I refactored the Titlecase and swapcase test cases.
Now they can be easily maintained because they are table based. 
Also less code for the same thing.