Generalized file import script with content detection, plus rudimentary tests.