updates file read to close file more quickly
unbreaks & DRYs my previous change.
adds the return back in (forgot in prev commit)
fixes if-logic for error condition
uses fail_with to bomb out on datastore probs
unretards the uri normalize loop
Merge logic cleanups from kernelsmith
Land #3047 for real.
Merge branch 'land-3047-really' into upstream-master