removed unused Code Parts
Added OnClose-Methods and General Shutdown Mechanism
Merge branch 'master' into Network