Auto-detect the originating cookbook.

Yes this code is crazy, so sue me.