Template engine optimized for fast and efficient updates