Added log module.

This log module will log to both console and a specified file, can
handle a certain number of log level and log masks, and allows setting
hooks to be executed when a message is logged.