Fix bug 29 and add test cases
Add writeFile function to Common.Java and one test case for it