[Version Control] Unit Tests refactor and addition:

Refactor logic of functions. Use more Util functions.
Fixed issue with clean repository not adding ignored files.
Fixed issue with .gitignore not existing when reading.