check_pkg function

check_pkg(): Check if packages are installed and optionally install them