add shutdown hook

Add shutdown hook to provide a controlled way of stopping. This should be provided in class Main.

What exactly should be done when the shutdown-hook is called? Especially looking at the different reasons for shutdown (system maintenance, corrupt disk, full disk, ...).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information