Converted cache files to use cStringIO
Added basic support for if statements
Done a little refactoring on template.py