Refactoring: extracting 'List.getPkgList' function out of 'List.list'

Extracting 'List.getPkgList' function out of 'List.list' function. The 'getPkgList' function returns list of packages and be used by external programs, when cabal-install becomes a library.