Added logging system and some early uses for it. Will be returning to this at a later date...