Use EventSystem to handle shutdown events.

Pre-emptively anticipating code. This currently won't work very well.
Merge branch 'basicframework' of github.com:dreac0nic/nimbus into basicframework