Given a path to js files and an optional precedence list, return file paths and names.