Fix misc. small bugs in ajax condensing and shift railgun html to template