Fast and flexible template engine