Add shutdown functionality (Pretty much the most important thing) v0.4