Add file-dir creation function and some tests