Replaced all tabs with spaces (tabs of 4)
Moved some HTML out of Javascript and into a template