Add basic logging.

The logging class is a modified version of Klogger v0.2.0. http://codefury.net/projects/klogger/