Cache template paths in a local variable.

Cache the possible template paths in locate_template() so they don't
have to be regenerated while looping through an list of templates.
Merge pull request #2 from bradyvercher/cache-paths

Cache template paths in a local variable.