More Code Reorganisation

Moved logging and message functionality to new module `logging.py`.