fixed outputdir and added tests

I hope this time will work!
I tested it on Ubuntu and Windows 7