File uri stripping to fix file_exists and is_dir

Supplants #1837 , though still uncertain whether this is an appropriate spot for it to be stripped.
+ Fixes #1847
+ Fixes #1835