Use a more efficient regex for keywords

Use regexp-opt to generate the regex to match keywords instead of
building it up by hand. The generated regex should be more efficient
than just combining all the keywords with "\\|".