Code infrastructure improvements

Split server.js - now storage.js handles all storage-related activities and server.js handles purely server-related activities.

Also, added a resume functionality - if there is a file at the target path, it's integrity will be checked piece by piece and only the missing pieces will be downloaded.