DAN-31 added better logging

Updated with NLog for logging and later reading, in cases where parsing
long repositories and useful to read log at a later stage.
DAN-31 cleaned up some code

clean up some code (still need to do more) to improve readability