Clean up templates, add analytics tracker