Refactor HTML completions

Eliminates 100+ lines of code; should be faster too
Merge pull request #48 from SLaks/code-cleanup

Refactor HTML completions