Added Design Documentation

Added design Documentation and did a fix in test.cpp where I forgot to
close some fstreams, hasn't caused any issues but it might at some
point.