optimising def loadLocal and def loadCatcher
bug fixes and added def log(s):.  Replaced if enable_debug statements and replaced them with def log(s) function.