Changed stream closing logic/Structural changes

Calculating the difference between 2 dates in a separate method.
CSVWriter and DBConnection implement the closeable interface and are
closed automatically. Comments added