put mode logic and filename reporting into resource so everybody can benefit
Merge pull request #54 from grosser/tests

put mode logic and filename reporting into resource so everybody can benefit