Added more encapsulation to enable entire source to be wrapped as a module exposing only SageLog.