properly identify a cookbook on disk by it's metadata

This will fix issues where cookbooks would be installed multiple times and potential crashes when vendoring or packaging cookbooks.