Changes to run on Linux

Changes to remove the Windows specific portions of the code and allow running on Linux (tested on Ubuntu 14.04).

Also fixed use of global temp dir, could cause concurrency issues