Moved utilities function to utils.js
Improved the way a file is downloaded, and fix a bug related to large files (using metadata).