Implement {{if}} and {{with}}, clean up the source a bit.