Implement LoggerAttachment (fixes #1547)

This feature allows the attachment of extra logging classes to ThreadedLoggers.

This implements a more powerful way to do what #1547 wanted without having race conditions or direct memory leaks on threads.

### Features to implement
* [x] Create \AttachableThreadedLogger
* [x] Implement \AttachableLogger and \LoggerAttachment for single-threaded loggers