code: function createFileTree (filePaths)
  {
    var path = require ('path')
      , root = {
      files:      [],
      subfolders: new Map
    };
  
    filePaths.forEach (function (filename)
    {
      var dir = path.dirname (filename)
        , folderPtr = root;
      if (dir)
        dir.split (path.sep).forEach (function (segment)
        {
          if (!folderPtr.subfolders.has (segment))
            folderPtr.subfolders.set (segment, {
              files:      [],
              subfolders: new Map
            });
          folderPtr = folderPtr.subfolders.get (segment);
        });
      folderPtr.files.push (filename);
    });
    return root;
  }
docs: Generates a tree of folder names and file names from a (possibliy) unsorted linear list of file paths.
  @param {string[]} filePaths
  @returns {{files: string[], subfolders: Map}}