Move mkdirs code into main filter class, make it not clash with
populate. Closes #50.