Preparing to remove some dependencies

- moving "pm list packages" into separate function
- package list info now stored into global array for re-use
- helper added: in_array (check whether "needle is in haystack")
- started converting some external calls to "Bashisms" (less fork, more speed)
two more "forks" replaced by "Bashisms"
adding "test" output dir to .gitignore