Move trie switch generation into Jinja template

Only change to output is sorting the trie:
currently trie is not sorted so output can vary from build to build.

Currently make_element_lookup_trie.py has complex Python code to generate a
switch statement for a trie.
This moves the code generation into a Jinja template, making generation
rather more transparent.

The key point in refactoring is separating the trie computation logic
from the code generation: compute the trie beforehand, then feed it to the CG.
This lets us make the code generation dumb and put it in Jinja.

R=abarth

Review URL: https://codereview.chromium.org/236063025

git-svn-id: svn://svn.chromium.org/blink/trunk@171829 bbb929c8-8fbe-4397-9dbb-9b2b20218538