Add some nunjucks compiler optimizations

It shaves 30K off Fireplace's templates file.