fixed some syntax errors, refactoring seems to work. datadir added
Match location used by node-webkit on linux.
fix for windows
Merge pull request #2 from mvhaen/master

Adding multi-platform support.