Fix os.writefile bug

See :
https://github.com/APE-Project/APE_Server/pull/42#issuecomment-40950314
Fix callback problem in resolveHostByName

See :
https://github.com/APE-Project/APE_Server/pull/42#issuecomment-40950314
Improved log output for better readability