Support running executables from Bundler gems and project-local scripts

This change is working but I'd like to refactor it a bit before merging in. I'm just opening this now to get some eyes on it.