Implemented logging framework. Changed all Debug.WriteLine to log entries.