Upgrade code to work on iOS

Hi, I have updated the DMTemplateEngine class to be run on iOS.

Thanks for writing this really simple and useful template library.

Cheers,
Nathan