Simplification and fixed bugs wrt files vs directories.
Fixed bug w/writing large files
fixed some ugly if-checks
Added makefile for easy testing
updated makefile with report