Changed working of fs.exists + minor updates

- changed working of fs.exists
- added cacheDir for faster changing cache dir.
- added port