Refactored js code and merged to the master

for temporary filesystem