Some refactoring

- Divided log into two functions, first just returns the formatted and colorized diff text, second logs the diff text to the console
- JSDocs