Switch default template based on syntax.
Fix bugs, rename functions, add event listeners.