Syntax and bugfixes, add test code for os_writeFile