close imports.
sectioning.
adding doc.
doc ordering.
refactoring and documentation.
more refactoring.
adding comments.
adding type alias.
adding killIfExist.
small refactoring.
adding comments about weak reference to ThreadId.