Add method to check if a string is a palindrome.

This pull request adds a method for checking whether a string is a palindrome or not. I hope that somebody will find it useful in any way.