Tidied up code quite a bit. Refactored into two packages for shutdown stuff. Created Main package. Added some ducomentation. Slight refactoring.