Adding logging functionality, requires monolog to be installed.
Fixing some issues