cache.js: Minor refactoring and cleanup
stash resolved data on data._resolved

Close #3054
Use stashed git sha in shrinkwrap install

Fix #3056