Moved logger to it's own files, added debug facilities, improved TODO documentation, etc.