oh wow... refactor match_targets

I don't know why match_targets is also adding packages to the cache, it
really should be simply returning a bool.
hack globbing into repo_database_remove
refactor match_target logic out
better globbing for a pkghash
glob_cache should return all results, not the first one