Move the matchPackage function in its own file.

It allow to use this function outside of the "install" command. Ex: future "update" command.