A JavaScript method for intelligently converting strings to title case.