Added writeProgram() and it test code
Merge pull request #9 from JacksonTeh/master

Added writeProgram() and it test code