Add a LRU cache so that shebangs resolutions are cached for a while.

Also make all tests work on unices.