Inclusion of doc string and "imports" in magdir.py