Centralising of the logging function to allow for different log levels and also removes the constant if/else to determine whether to output a log or not.

The centralised variable gc now has a attribute gc.coreFunctions which so far contains the log function but will eventually contain any globally required functions.