Minor optimizations to reverse_words.php