Added support for passing in variables to control time

plus extensive logging support