Make replace_imports work with subdirectories...

Hopefully.  Also add a test example.