Updated logging system.
Improved logic for discovery of current Git ref.