Fix for non existent fs.existsSync function
In some node.js versions like in Raspberry Pi, fs does not have existsSync method. This commit checks for existence of the mentioned method and in negative case, fs.existsSync is overwriten with the one in 'path'