Move html completion logic to html_completions.js