Better ignoring of .DS_Store files
Refactored, added some tests