Added first round of peephole optimization, although it's a little hamfisted
Added writing of output to files