move more HTML generation into templates
move compare function to utils and fix JS
some form cleanup
no more globals for building tags