Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 10622)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 10624)
@@ -29,7 +29,5 @@
   Main.cc
   MoodManager.cc
-  PawnManager.cc
   PlayerManager.cc
-  ShipPartManager.cc
   Radar.cc
 #  Test.cc
Index: code/trunk/src/orxonox/CameraManager.cc
===================================================================
--- code/trunk/src/orxonox/CameraManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/CameraManager.cc	(revision 10624)
@@ -35,8 +35,8 @@
 #include <OgreCompositorManager.h>
 
-#include "util/ScopedSingletonManager.h"
 #include "core/GameMode.h"
 #include "core/GraphicsManager.h"
 #include "core/object/ObjectList.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "tools/Shader.h"
 #include "graphics/Camera.h"
@@ -44,5 +44,5 @@
 namespace orxonox
 {
-    ManageScopedSingleton(CameraManager, ScopeID::Graphics, false);
+    ManageScopedSingleton(CameraManager, ScopeID::GRAPHICS, false);
 
     CameraManager::CameraManager()
Index: code/trunk/src/orxonox/Level.cc
===================================================================
--- code/trunk/src/orxonox/Level.cc	(revision 10622)
+++ code/trunk/src/orxonox/Level.cc	(revision 10624)
@@ -35,4 +35,5 @@
 #include "core/XMLFile.h"
 #include "core/XMLPort.h"
+#include "core/module/PluginReference.h"
 
 #include "infos/PlayerInfo.h"
@@ -49,4 +50,5 @@
         RegisterObject(Level);
 
+        this->setLevel(WeakPtr<Level>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
 
         this->registerVariables();
@@ -63,5 +65,7 @@
 
             if (this->xmlfile_)
-                Loader::unload(this->xmlfile_);
+                Loader::getInstance().unload(this->xmlfile_);
+
+            this->unloadPlugins();
         }
     }
@@ -71,4 +75,5 @@
         SUPER(Level, XMLPort, xmlelement, mode);
 
+        XMLPortParam(Level, "plugins",  setPluginsString,  getPluginsString,  xmlelement, mode);
         XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
 
@@ -95,5 +100,5 @@
         this->xmlfile_ = new XMLFile(mask, this->xmlfilename_);
 
-        Loader::open(this->xmlfile_);
+        Loader::getInstance().load(this->xmlfile_);
     }
 
@@ -105,4 +110,31 @@
             Template::getTemplate(*it)->applyOn(this);
         }
+    }
+
+    void Level::setPluginsString(const std::string& pluginsString)
+    {
+        // unload old plugins
+        this->unloadPlugins();
+
+        // load new plugins
+        this->pluginsString_ = pluginsString;
+        SubString tokens(pluginsString, ",");
+        for (size_t i = 0; i < tokens.size(); ++i)
+            this->plugins_.push_back(new PluginReference(tokens[i]));
+    }
+
+    void Level::unloadPlugins()
+    {
+        // use destroyLater() - this ensures that plugins are not unloaded too early.
+        // Note: When a level gets unloaded, the Level object is usually the last object that gets destroyed. This is because all other
+        //       objects inside a level have a StrongPtr (in BaseObject) that references the Level object. This means that the Level
+        //       object is only destroyed, when all StrongPtrs that pointed to it were destroyed. But at the time when the last StrongPtr
+        //       is destroyed, the other object is not yet fully destroyed because the StrongPtr is destroyed in ~BaseObject (and this
+        //       means that e.g. ~Identifiable was not yet called for this object). This means that technically there are still other
+        //       objects alive when ~Level is called. This is the reason why we cannot directly destroy() the Plugins - instead we need
+        //       to call destroyLater() to ensure that no instances from this plugin exist anymore.
+        for (std::list<PluginReference*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it)
+            (*it)->destroyLater();
+        this->plugins_.clear();
     }
 
@@ -121,8 +153,9 @@
 
         Gametype* rootgametype = orxonox_cast<Gametype*>(identifier->fabricate(this));
-        this->setGametype(rootgametype);
-
-        for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
-            (*it)->setGametype(rootgametype);
+
+        // store a weak-pointer to the gametype to avoid a circular dependency between this level and the gametype (which has a strong-reference on this level)
+        this->setGametype(WeakPtr<Gametype>(rootgametype));
+
+        rootgametype->init(); // call init() AFTER the gametype was set
 
         if (LevelManager::exists())
@@ -134,6 +167,4 @@
     {
         this->objects_.push_back(object);
-        object->setGametype(this->getGametype());
-        object->setLevel(this);
     }
 
@@ -170,5 +201,5 @@
     {
         orxout(internal_info) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl;
-        player->setGametype(this->getGametype());
+        player->switchGametype(this->getGametype());
     }
 
@@ -176,5 +207,5 @@
     {
         orxout(internal_info) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl;
-        player->setGametype(0);
+        player->switchGametype(0);
     }
 }
Index: code/trunk/src/orxonox/Level.h
===================================================================
--- code/trunk/src/orxonox/Level.h	(revision 10622)
+++ code/trunk/src/orxonox/Level.h	(revision 10624)
@@ -65,4 +65,10 @@
 //            MeshLodInformation* getLodInfo(unsigned int index) const;
 
+            void setPluginsString(const std::string& pluginsString);
+            inline const std::string& getPluginsString() const
+                { return this->pluginsString_; }
+
+            void unloadPlugins();
+
             void setGametypeString(const std::string& gametype);
             inline const std::string& getGametypeString() const
@@ -70,4 +76,7 @@
 
             void networkcallback_applyXMLFile();
+
+            std::string                    pluginsString_;
+            std::list<PluginReference*>    plugins_;
 
             std::string                    gametype_;
Index: code/trunk/src/orxonox/LevelManager.cc
===================================================================
--- code/trunk/src/orxonox/LevelManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/LevelManager.cc	(revision 10624)
@@ -36,6 +36,6 @@
 #include <map>
 
-#include "util/ScopedSingletonManager.h"
-#include "core/config/CommandLineParser.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "core/commandline/CommandLineIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
@@ -51,5 +51,7 @@
     SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
 
-    ManageScopedSingleton(LevelManager, ScopeID::Root, false);
+    ManageScopedSingleton(LevelManager, ScopeID::ROOT, false);
+
+    RegisterAbstractClass(LevelManager).inheritsFrom<Configurable>();
 
     /**
@@ -274,5 +276,5 @@
                 // Load the LevelInfo object from the level file.
                 XMLFile file = XMLFile(*it);
-                Loader::load(&file, mask, false, true);
+                Loader::getInstance().load(&file, mask, false, true);
 
                 // Find the LevelInfo object we've just loaded (if there was one)
@@ -282,5 +284,5 @@
 
                 // We don't need the loaded stuff anymore
-                Loader::unload(&file);
+                Loader::getInstance().unload(&file);
 
                 if(info == NULL)
Index: code/trunk/src/orxonox/Main.cc
===================================================================
--- code/trunk/src/orxonox/Main.cc	(revision 10622)
+++ code/trunk/src/orxonox/Main.cc	(revision 10624)
@@ -36,5 +36,5 @@
 #include "Main.h"
 
-#include "core/config/CommandLineParser.h"
+#include "core/commandline/CommandLineIncludes.h"
 #include "core/Game.h"
 #include "core/LuaState.h"
Index: code/trunk/src/orxonox/MoodManager.cc
===================================================================
--- code/trunk/src/orxonox/MoodManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/MoodManager.cc	(revision 10624)
@@ -29,5 +29,5 @@
 #include "MoodManager.h"
 
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
@@ -36,8 +36,11 @@
 namespace orxonox
 {
-    ManageScopedSingleton(MoodManager, ScopeID::Root, false);
+    ManageScopedSingleton(MoodManager, ScopeID::ROOT, false);
 
     // Note: I'm (Kevin Young) not entirely sure whether that's good code style:
     const std::string MoodManager::defaultMood_ = "default";
+
+    RegisterAbstractClass(MoodListener).inheritsFrom<OrxonoxInterface>();
+    RegisterAbstractClass(MoodManager).inheritsFrom<Configurable>();
 
     MoodManager::MoodManager()
Index: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 10622)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 10624)
@@ -73,5 +73,4 @@
     class LevelInfoItem;
     class LevelManager;
-    class PawnManager;
     class PlayerManager;
     class Radar;
Index: code/trunk/src/orxonox/PawnManager.cc
===================================================================
--- code/trunk/src/orxonox/PawnManager.cc	(revision 10622)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "PawnManager.h"
-
-#include "util/ScopedSingletonManager.h"
-#include "core/CoreIncludes.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
-    ManageScopedSingleton(PawnManager, ScopeID::Root, false);
-
-    PawnManager::PawnManager()
-    {
-        RegisterObject(PawnManager);
-    }
-
-    PawnManager::~PawnManager()
-    {
-        // Be sure to delete all the pawns
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); )
-            (it++)->destroy();
-    }
-
-    void PawnManager::preUpdate(const Clock& time)
-    {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); )
-        {
-            if (!it->isAlive())
-                (it++)->destroy();
-            else
-                ++it;
-        }
-    }
-}
Index: code/trunk/src/orxonox/PawnManager.h
===================================================================
--- code/trunk/src/orxonox/PawnManager.h	(revision 10622)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _PawnManager_H__
-#define _PawnManager_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "util/Singleton.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport PawnManager : public Singleton<PawnManager>, public Tickable
-    {
-            friend class Singleton<PawnManager>;
-        public:
-            PawnManager();
-            virtual ~PawnManager();
-
-            virtual void preUpdate(const Clock& time);
-
-        private:
-
-            static PawnManager* singletonPtr_s;
-    };
-}
-
-#endif /* _PawnManager_H__ */
Index: code/trunk/src/orxonox/PlayerManager.cc
===================================================================
--- code/trunk/src/orxonox/PlayerManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/PlayerManager.cc	(revision 10624)
@@ -31,5 +31,5 @@
 #include "core/CoreIncludes.h"
 #include "core/GameMode.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 
 #include "Level.h"
@@ -39,5 +39,7 @@
 namespace orxonox
 {
-    ManageScopedSingleton(PlayerManager, ScopeID::Root, false);
+    ManageScopedSingleton(PlayerManager, ScopeID::ROOT, false);
+
+    RegisterAbstractClass(PlayerManager).inheritsFrom<ClientConnectionListener>();
 
     PlayerManager::PlayerManager()
Index: code/trunk/src/orxonox/Radar.cc
===================================================================
--- code/trunk/src/orxonox/Radar.cc	(revision 10622)
+++ code/trunk/src/orxonox/Radar.cc	(revision 10624)
@@ -37,4 +37,5 @@
 
 //#include "util/Math.h"
+#include "core/CoreIncludes.h"
 #include "core/object/ObjectList.h"
 #include "core/command/ConsoleCommand.h"
@@ -45,4 +46,5 @@
 namespace orxonox
 {
+    RegisterAbstractClass(Radar).inheritsFrom<Tickable>();
 
     Radar::Radar()
Index: code/trunk/src/orxonox/Scene.cc
===================================================================
--- code/trunk/src/orxonox/Scene.cc	(revision 10622)
+++ code/trunk/src/orxonox/Scene.cc	(revision 10624)
@@ -44,5 +44,5 @@
 #include "core/GUIManager.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "tools/BulletConversions.h"
 #include "tools/BulletDebugDrawer.h"
@@ -62,9 +62,11 @@
         RegisterObject(Scene);
 
-        this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN);
+        this->setScene(WeakPtr<Scene>(this), this->getObjectID()); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
+
         this->bShadows_ = true;
         this->bDebugDrawPhysics_ = false;
         this->debugDrawer_ = NULL;
         this->soundReferenceDistance_ = 20.0;
+        this->bIsUpdatingPhysics_ = false;
 
         if (GameMode::showsGraphics())
@@ -141,5 +143,4 @@
         registerVariable(this->bHasPhysics_,        VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));
         registerVariable(this->bShadows_,           VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));
-        registerVariable(this->getLevel(),          VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::changedLevel));
     }
 
@@ -266,8 +267,10 @@
             // Note: 60 means that Bullet will do physics correctly down to 1 frames per seconds.
             //       Under that mark, the simulation will "loose time" and get unusable.
-            physicalWorld_->stepSimulation(dt, 60);
+            this->bIsUpdatingPhysics_ = true;
+            this->physicalWorld_->stepSimulation(dt, 60);
+            this->bIsUpdatingPhysics_ = false;
 
             if (this->bDebugDrawPhysics_)
-                physicalWorld_->debugDrawWorld();
+                this->physicalWorld_->debugDrawWorld();
         }
     }
@@ -313,5 +316,4 @@
     {
         this->objects_.push_back(object);
-        object->setScene(this, this->getObjectID());
     }
 
@@ -363,6 +365,6 @@
     {
         // get the WorldEntity pointers
-        SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
-        SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
+        StrongPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
+        StrongPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
 
         // get the CollisionShape pointers
Index: code/trunk/src/orxonox/Scene.h
===================================================================
--- code/trunk/src/orxonox/Scene.h	(revision 10622)
+++ code/trunk/src/orxonox/Scene.h	(revision 10624)
@@ -110,5 +110,5 @@
 
         public:
-            inline bool hasPhysics()
+            inline bool hasPhysics() const
                 { return this->physicalWorld_ != 0; }
             void setPhysicalWorld(bool wantsPhysics);
@@ -128,4 +128,7 @@
             void addPhysicalObject(WorldEntity* object);
             void removePhysicalObject(WorldEntity* object);
+
+            inline bool isUpdatingPhysics() const
+                { return this->bIsUpdatingPhysics_; }
 
             void setDebugDrawPhysics(bool bDraw, bool bFill, float fillAlpha);
@@ -163,4 +166,5 @@
             BulletDebugDrawer*                   debugDrawer_;
             bool                                 bDebugDrawPhysics_;
+            bool                                 bIsUpdatingPhysics_;
     };
 }
Index: code/trunk/src/orxonox/ShipPartManager.cc
===================================================================
--- code/trunk/src/orxonox/ShipPartManager.cc	(revision 10622)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "ShipPartManager.h"
-
-#include "util/ScopedSingletonManager.h"
-#include "core/CoreIncludes.h"
-#include "items/ShipPart.h"
-
-namespace orxonox
-{
-    ManageScopedSingleton(ShipPartManager, ScopeID::Root, false);
-
-    ShipPartManager::ShipPartManager()
-    {
-        RegisterObject(ShipPartManager);
-    }
-
-    ShipPartManager::~ShipPartManager()
-    {
-        // Be sure to delete all the pawns
-        for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
-            (it++)->death();
-    }
-
-    void ShipPartManager::preUpdate(const Clock& time)
-    {
-        for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
-        {
-            if (!it->isAlive())
-                (it++)->death();
-            else
-                ++it;
-        }
-    }
-}
Index: code/trunk/src/orxonox/ShipPartManager.h
===================================================================
--- code/trunk/src/orxonox/ShipPartManager.h	(revision 10622)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _ShipPartManager_H__
-#define _ShipPartManager_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "util/Singleton.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport ShipPartManager : public Singleton<ShipPartManager>, public Tickable
-    {
-            friend class Singleton<ShipPartManager>;
-        public:
-            ShipPartManager();
-            virtual ~ShipPartManager();
-
-            virtual void preUpdate(const Clock& time);
-
-        private:
-
-            static ShipPartManager* singletonPtr_s;
-    };
-}
-
-#endif /* _ShipPartManager_H__ */
Index: code/trunk/src/orxonox/Test.cc
===================================================================
--- code/trunk/src/orxonox/Test.cc	(revision 10622)
+++ code/trunk/src/orxonox/Test.cc	(revision 10624)
@@ -29,6 +29,6 @@
 #include "core/CoreIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
-#include "core/command/ConsoleCommand.h"
-#include "network/NetworkFunction.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "network/NetworkFunctionIncludes.h"
 #include "Test.h"
 #include "util/MultiType.h"
@@ -105,11 +105,11 @@
   void Test::call(unsigned int clientID)
     {
-        callStaticNetworkFunction( &Test::printV1, clientID );
-        callStaticNetworkFunction( &Test::printV1, clientID );
+        callStaticNetworkFunction(&Test::printV1, clientID );
+        callStaticNetworkFunction(&Test::printV1, clientID );
     }
 
     void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4)
     {
-        callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );
+        callMemberNetworkFunction( &Test::printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );
     }
 
@@ -130,5 +130,5 @@
     //     if(!Core::isMaster())
     //       call2(0, "bal", "a", "n", "ce");
-    //       callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 );
+    //       callMemberNetworkFunction( &Test::checkU1, this->getObjectID(), 0 );
     }
 
Index: code/trunk/src/orxonox/chat/ChatHistory.cc
===================================================================
--- code/trunk/src/orxonox/chat/ChatHistory.cc	(revision 10622)
+++ code/trunk/src/orxonox/chat/ChatHistory.cc	(revision 10624)
@@ -28,5 +28,6 @@
 
 #include "ChatHistory.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "core/ConfigurablePaths.h"
 
 #ifndef CHATTEST
@@ -34,5 +35,8 @@
 {
   /* singleton */
-  ManageScopedSingleton( ChatHistory, ScopeID::Root, false );
+  ManageScopedSingleton( ChatHistory, ScopeID::ROOT, false );
+
+  RegisterAbstractClass(ChatHistory).inheritsFrom<ChatListener>();
+
 #endif
 
@@ -118,5 +122,5 @@
      */
 #ifndef CHATTEST
-    this->hist_logfile.open( (PathConfig::getInstance().getLogPathString() +
+    this->hist_logfile.open( (ConfigurablePaths::getLogPathString() +
       "chatlog.log").c_str(),
       std::fstream::out | std::fstream::app );
Index: code/trunk/src/orxonox/chat/ChatHistory.h
===================================================================
--- code/trunk/src/orxonox/chat/ChatHistory.h	(revision 10622)
+++ code/trunk/src/orxonox/chat/ChatHistory.h	(revision 10624)
@@ -41,5 +41,4 @@
 #include "util/Singleton.h"
 #include "core/BaseObject.h"
-#include "core/PathConfig.h"
 #include "chat/ChatListener.h"
 #include "infos/PlayerInfo.h"
Index: code/trunk/src/orxonox/chat/ChatInputHandler.cc
===================================================================
--- code/trunk/src/orxonox/chat/ChatInputHandler.cc	(revision 10622)
+++ code/trunk/src/orxonox/chat/ChatInputHandler.cc	(revision 10624)
@@ -47,8 +47,8 @@
 #endif
 
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "core/CoreIncludes.h"
 #include "core/GUIManager.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/input/InputBuffer.h"
 #include "core/input/InputManager.h"
@@ -62,9 +62,11 @@
 {
   /* singleton */
-  ManageScopedSingleton( ChatInputHandler, ScopeID::Graphics, false );
+  ManageScopedSingleton( ChatInputHandler, ScopeID::GRAPHICS, false );
 
   /* add commands to console */
   SetConsoleCommand( "startchat", &ChatInputHandler::activate_static );
   SetConsoleCommand( "startchat_small", &ChatInputHandler::activate_small_static );
+
+  RegisterAbstractClass(ChatInputHandler).inheritsFrom<ChatListener>();
 
   /* constructor */
Index: code/trunk/src/orxonox/chat/ChatManager.cc
===================================================================
--- code/trunk/src/orxonox/chat/ChatManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/chat/ChatManager.cc	(revision 10624)
@@ -30,7 +30,7 @@
 #include "ChatListener.h"
 
-#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "network/Host.h"
 
@@ -40,7 +40,9 @@
 namespace orxonox
 {
-    ManageScopedSingleton(ChatManager, ScopeID::Root, false);
+    ManageScopedSingleton(ChatManager, ScopeID::ROOT, false);
 
     SetConsoleCommand("chat", &ChatManager::chat).defaultValue(1, NETWORK_PEER_ID_BROADCAST);
+
+    RegisterAbstractClass(ChatManager).inheritsFrom<NetworkChatListener>();
 
     ChatManager::ChatManager()
@@ -113,5 +115,5 @@
     // ChatListener                                                         //
     //////////////////////////////////////////////////////////////////////////
-    RegisterAbstractClass(ChatListener).inheritsFrom(Class(Listable));
+    RegisterAbstractClass(ChatListener).inheritsFrom<Listable>();
 
     ChatListener::ChatListener()
Index: code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CollisionShape.cc	(revision 10622)
+++ code/trunk/src/orxonox/collisionshapes/CollisionShape.cc	(revision 10624)
@@ -41,8 +41,9 @@
 #include "CompoundCollisionShape.h"
 #include "WorldEntityCollisionShape.h"
+#include "Scene.h"
 
 namespace orxonox
 {
-    RegisterAbstractClass(CollisionShape).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable));
+    RegisterAbstractClass(CollisionShape).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>();
 
     /**
@@ -74,6 +75,15 @@
     {
         // Detach from parent CompoundCollisionShape.
-        if (this->isInitialized() && this->parent_)
-            this->parent_->detach(this);
+        if (this->isInitialized())
+        {
+            if (this->getScene() && this->getScene()->isUpdatingPhysics())
+                orxout(internal_error) << "Don't destroy collision shapes while the physics is updated! This will lead to crashes. Try to use destroyLater() instead" << endl;
+
+            if (this->parent_)
+                this->parent_->detach(this);
+
+            if (this->collisionShape_)
+                delete this->collisionShape_;
+        }
     }
 
Index: code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 10622)
+++ code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 10624)
@@ -71,7 +71,11 @@
                 it->first->notifyDetached();
                 it->first->destroy();
+                if (this->collisionShape_ == it->second)
+                    this->collisionShape_ = NULL; // don't destroy it twice
             }
 
             delete this->compoundShape_;
+            if (this->collisionShape_ == this->compoundShape_)
+                this->collisionShape_ = NULL; // don't destroy it twice
         }
     }
Index: code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc	(revision 10622)
+++ code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc	(revision 10624)
@@ -37,4 +37,6 @@
 namespace orxonox
 {
+    RegisterClass(WorldEntityCollisionShape);
+
     WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context)
     {
@@ -44,9 +46,4 @@
         // suppress synchronisation
         this->setSyncMode(ObjectDirection::None);
-    }
-
-    WorldEntityCollisionShape::~WorldEntityCollisionShape()
-    {
-        // Called always by WE destructor
     }
 
Index: code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h
===================================================================
--- code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h	(revision 10622)
+++ code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h	(revision 10624)
@@ -39,5 +39,4 @@
         public:
             WorldEntityCollisionShape(Context* context);
-            virtual ~WorldEntityCollisionShape();
 
             inline void setWorldEntityOwner(WorldEntity* worldEntityOwner)
Index: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 10622)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 10624)
@@ -30,5 +30,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "worldentities/pawns/Pawn.h"
 #include "worldentities/pawns/SpaceShip.h"
Index: code/trunk/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/FormationController.cc	(revision 10622)
+++ code/trunk/src/orxonox/controllers/FormationController.cc	(revision 10624)
@@ -33,5 +33,5 @@
 
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "worldentities/ControllableEntity.h"
Index: code/trunk/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.cc	(revision 10622)
+++ code/trunk/src/orxonox/controllers/HumanController.cc	(revision 10624)
@@ -30,5 +30,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
@@ -59,6 +59,4 @@
     SetConsoleCommand("HumanController", __CC_suicide_name,        &HumanController::suicide       ).addShortcut();
     SetConsoleCommand("HumanController", "toggleGodMode",          &HumanController::toggleGodMode ).addShortcut();
-    SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
-    SetConsoleCommand("HumanController", "killBots",               &HumanController::killBots      ).addShortcut().defaultValues(0);
     SetConsoleCommand("HumanController", "cycleNavigationFocus",   &HumanController::cycleNavigationFocus).addShortcut();
     SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut();
@@ -318,16 +316,4 @@
     }
 
-    void HumanController::addBots(unsigned int amount)
-    {
-        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())
-            HumanController::localController_s->controllableEntity_->getGametype()->addBots(amount);
-    }
-
-    void HumanController::killBots(unsigned int amount)
-    {
-        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())
-            HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount);
-    }
-
     Pawn* HumanController::getLocalControllerEntityAsPawn()
     {
Index: code/trunk/src/orxonox/controllers/HumanController.h
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.h	(revision 10622)
+++ code/trunk/src/orxonox/controllers/HumanController.h	(revision 10624)
@@ -83,7 +83,4 @@
             static void FFChangeMode();
 
-            static void addBots(unsigned int amount);
-            static void killBots(unsigned int amount = 0);
-
             static void pauseControl(); // tolua_export
             static void resumeControl(); // tolua_export
Index: code/trunk/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 10622)
+++ code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 10624)
@@ -37,5 +37,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/input/KeyBinder.h"
 #include "core/input/KeyBinderManager.h"
Index: code/trunk/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 10624)
@@ -30,5 +30,5 @@
 
 #include "util/Exception.h"
-#include "core/config/CommandLineParser.h"
+#include "core/commandline/CommandLineIncludes.h"
 #include "core/Game.h"
 #include "core/GameMode.h"
Index: code/trunk/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 10624)
@@ -44,7 +44,8 @@
 #include "core/Loader.h"
 #include "core/XMLFile.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "LevelManager.h"
+#include "Level.h"
 #include "PlayerManager.h"
 #include "GSRoot.h"
@@ -95,4 +96,6 @@
         }
 
+        this->prepareObjectTracking();
+
         if (GameMode::isMaster())
         {
@@ -128,4 +131,8 @@
         if (GameMode::isMaster())
             this->unloadLevel();
+        else
+            this->unloadLevelAsClient();
+
+        this->performObjectTracking();
 
         if (GameMode::showsGraphics())
@@ -161,23 +168,12 @@
     }
 
-    void GSLevel::loadLevel()
+    void GSLevel::prepareObjectTracking()
     {
         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
             this->staticObjects_.insert(*it);
-
-        // call the loader
-        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
-        bool loaded = Loader::open(startFile_);
-
-        Core::getInstance().updateLastLevelTimestamp();
-        if(!loaded)
-            GSRoot::delayedStartMainMenu();
-    }
-
-    void GSLevel::unloadLevel()
-    {
-        Loader::unload(startFile_);
-        delete startFile_;
-
+    }
+
+    void GSLevel::performObjectTracking()
+    {
         orxout(internal_info) << "Remaining objects:" << endl;
         unsigned int i = 0;
@@ -187,5 +183,5 @@
             if (find == this->staticObjects_.end())
             {
-                orxout(internal_info) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
+                orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
             }
         }
@@ -194,4 +190,43 @@
         else
             orxout(internal_warning) << i << " objects remaining. Try harder!" << endl;
+    }
+
+    void GSLevel::loadLevel()
+    {
+        // call the loader
+        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
+        bool loaded = Loader::getInstance().load(startFile_);
+
+        Core::getInstance().getConfig()->updateLastLevelTimestamp();
+        if(!loaded)
+            GSRoot::delayedStartMainMenu();
+    }
+
+    void GSLevel::unloadLevel()
+    {
+        Loader::getInstance().unload(startFile_);
+        delete startFile_;
+    }
+
+    /**
+     * Unloads a level when the game instance is (or was) a client in a multiplayer session.
+     * In this case, cleanup after unloading a level is done differently because certain things (e.g. the xml file) are unknown.
+     */
+    void GSLevel::unloadLevelAsClient()
+    {
+        for (ObjectList<Level>::iterator it = ObjectList<Level>::begin(); it != ObjectList<Level>::end(); )
+        {
+            StrongPtr<Level> level = *(it++); // StrongPtr prevents that the Level gets destroyed while we loop over it
+            for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(level); it != ObjectList<BaseObject>::end(level); )
+                (it++)->destroy();
+        }
+
+        for (ObjectList<Synchronisable>::iterator it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); )
+        {
+            if (it->getSyncMode() != 0x0)
+                (it++)->destroy();
+            else
+                ++it;
+        }
     }
 
@@ -252,5 +287,5 @@
     ///////////////////////////////////////////////////////////////////////////
 
-    RegisterAbstractClass(GSLevelMemento).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(GSLevelMemento).inheritsFrom<OrxonoxInterface>();
 
     GSLevelMemento::GSLevelMemento()
Index: code/trunk/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 10624)
@@ -53,7 +53,11 @@
         void reloadLevel();
 
-    protected:
+    private:
         void loadLevel();
         void unloadLevel();
+        void unloadLevelAsClient();
+
+        void prepareObjectTracking();
+        void performObjectTracking();
 
         InputState*              gameInputState_;          //!< input state for normal ingame playing
Index: code/trunk/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSMainMenu.cc	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSMainMenu.cc	(revision 10624)
@@ -36,5 +36,5 @@
 #include "core/GraphicsManager.h"
 #include "core/GUIManager.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "core/input/KeyBinderManager.h"
 #include "network/Client.h"
@@ -63,4 +63,6 @@
     SetConsoleCommand(__CC_setMainMenuSoundPath_name, &GSMainMenu::setMainMenuSoundPath).hide();
 
+    RegisterAbstractClass(GSMainMenu).inheritsFrom<Configurable>();
+
     GSMainMenu::GSMainMenu(const GameStateInfo& info)
         : GameState(info)
Index: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 10624)
@@ -33,6 +33,6 @@
 #include "core/Game.h"
 #include "core/GameMode.h"
-#include "core/command/ConsoleCommand.h"
-#include "network/NetworkFunction.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "network/NetworkFunctionIncludes.h"
 #include "tools/Timer.h"
 #include "tools/interfaces/Tickable.h"
@@ -68,5 +68,4 @@
     GSRoot::~GSRoot()
     {
-        NetworkFunctionBase::destroyAllNetworkFunctions();
     }
 
Index: code/trunk/src/orxonox/gamestates/GSServer.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSServer.cc	(revision 10622)
+++ code/trunk/src/orxonox/gamestates/GSServer.cc	(revision 10624)
@@ -30,5 +30,5 @@
 
 #include "util/Output.h"
-#include "core/config/CommandLineParser.h"
+#include "core/commandline/CommandLineIncludes.h"
 #include "core/Game.h"
 #include "core/GameMode.h"
Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 10622)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.cc	(revision 10624)
@@ -310,10 +310,7 @@
         if (spaceship)
         {
-            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
-            if(ptr == NULL)
-                return;
             spaceship->addSpeedFactor(5);
             ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
-            executor->setDefaultValue(0, ptr);
+            executor->setDefaultValue(0, spaceship);
             new Timer(10, false, executor, true);
         }
@@ -593,11 +590,10 @@
     }
 
-    void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function
-    {
-        if (*ptr)
-        {
-            (*ptr)->addSpeedFactor(1.0f/5.0f);
-        }
-        delete ptr;
+    void Dynamicmatch::resetSpeedFactor(SpaceShip* spaceship)// helper function
+    {
+        if (spaceship)
+        {
+            spaceship->addSpeedFactor(1.0f/5.0f);
+        }
     }
 
Index: code/trunk/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 10622)
+++ code/trunk/src/orxonox/gametypes/Dynamicmatch.h	(revision 10624)
@@ -77,5 +77,5 @@
             virtual void rewardPig();
             void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost.
-            void resetSpeedFactor(WeakPtr<SpaceShip>* ptr);
+            void resetSpeedFactor(SpaceShip* spaceship);
             void tick (float dt);// used to end the game
             SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
Index: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 10622)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 10624)
@@ -34,5 +34,5 @@
 #include "core/config/ConfigValueIncludes.h"
 #include "core/GameMode.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "gamestates/GSLevel.h"
 
@@ -49,4 +49,10 @@
 namespace orxonox
 {
+    static const std::string __CC_addBots_name  = "addBots";
+    static const std::string __CC_killBots_name = "killBots";
+
+    SetConsoleCommand("Gametype", __CC_addBots_name,  &Gametype::addBots ).addShortcut().defaultValues(1);
+    SetConsoleCommand("Gametype", __CC_killBots_name, &Gametype::killBots).addShortcut().defaultValues(0);
+
     RegisterUnloadableClass(Gametype);
 
@@ -55,9 +61,10 @@
         RegisterObject(Gametype);
 
+        this->setGametype(WeakPtr<Gametype>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
+
         this->gtinfo_ = new GametypeInfo(context);
 
-        this->setGametype(SmartPtr<Gametype>(this, false));
-
         this->defaultControllableEntity_ = Class(Spectator);
+        this->scoreboard_ = 0;
 
         this->bAutoStart_ = false;
@@ -74,29 +81,31 @@
         this->setConfigValues();
 
+        ModifyConsoleCommand(__CC_addBots_name).setObject(this);
+        ModifyConsoleCommand(__CC_killBots_name).setObject(this);
+    }
+
+    Gametype::~Gametype()
+    {
+        if (this->isInitialized())
+        {
+            if (this->gtinfo_)
+                this->gtinfo_->destroy();
+
+            ModifyConsoleCommand(__CC_addBots_name).setObject(NULL);
+            ModifyConsoleCommand(__CC_killBots_name).setObject(NULL);
+        }
+    }
+
+    /**
+     * @brief Initializes sub-objects of the Gametype. This must be called after the constructor.
+     * At this point, the context is expected to have the current gametype. This allows to pass the current gametype to the sub-objects via constructor.
+     */
+    void Gametype::init()
+    {
         // load the corresponding score board
         if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty())
         {
-            this->scoreboard_ = new OverlayGroup(context);
+            this->scoreboard_ = new OverlayGroup(this->getContext());
             this->scoreboard_->addTemplate(this->scoreboardTemplate_);
-            this->scoreboard_->setGametype(this);
-        }
-        else
-            this->scoreboard_ = 0;
-
-        /* HACK HACK HACK */
-        this->dedicatedAddBots_ = createConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) );
-        this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );
-        /* HACK HACK HACK */
-    }
-
-    Gametype::~Gametype()
-    {
-        if (this->isInitialized())
-        {
-            this->gtinfo_->destroy();
-            if( this->dedicatedAddBots_ )
-                delete this->dedicatedAddBots_;
-            if( this->dedicatedKillBots_ )
-                delete this->dedicatedKillBots_;
         }
     }
@@ -406,5 +415,5 @@
                     {
                         // If in developer's mode, there is no start countdown.
-                        if(Core::getInstance().inDevMode())
+                        if(Core::getInstance().getConfig()->inDevMode())
                             this->start();
                         else
Index: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	(revision 10622)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	(revision 10624)
@@ -72,4 +72,6 @@
             virtual ~Gametype();
 
+            virtual void init();
+
             void setConfigValues();
 
@@ -176,5 +178,5 @@
             virtual void importMementoState(const std::vector<GSLevelMementoState*>& states);
 
-            SmartPtr<GametypeInfo> gtinfo_;
+            WeakPtr<GametypeInfo> gtinfo_;
 
             bool bAutoStart_;
@@ -199,8 +201,4 @@
             std::string scoreboardTemplate_;
 
-            /* HACK HACK HACK */
-            ConsoleCommand* dedicatedAddBots_;
-            ConsoleCommand* dedicatedKillBots_;
-            /* HACK HACK HACK */
             Timer showMenuTimer_;
     };
Index: code/trunk/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Mission.cc	(revision 10622)
+++ code/trunk/src/orxonox/gametypes/Mission.cc	(revision 10624)
@@ -33,5 +33,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "infos/PlayerInfo.h"
 #include "network/Host.h"
Index: code/trunk/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 10622)
+++ code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "core/GameMode.h"
 #include "network/Host.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 #include "util/Convert.h"
 
@@ -369,5 +369,5 @@
                 this->changedReadyToSpawn(ready);
             else
-                callMemberNetworkFunction(GametypeInfo, changedReadyToSpawn, this->getObjectID(), player->getClientID(), ready);
+                callMemberNetworkFunction(&GametypeInfo::changedReadyToSpawn, this->getObjectID(), player->getClientID(), ready);
         }
     }
@@ -388,5 +388,5 @@
                     this->changedSpawned(spawned);
             else
-                callMemberNetworkFunction(GametypeInfo, changedSpawned, this->getObjectID(), player->getClientID(), spawned);
+                callMemberNetworkFunction(&GametypeInfo::changedSpawned, this->getObjectID(), player->getClientID(), spawned);
         }
     }
@@ -399,5 +399,5 @@
         if (GameMode::isMaster())
         {
-            callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message);
+            callMemberNetworkFunction(&GametypeInfo::dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message);
             this->dispatchAnnounceMessage(message);
         }
@@ -411,5 +411,5 @@
                 this->dispatchAnnounceMessage(message);
             else
-                callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), clientID, message);
+                callMemberNetworkFunction(&GametypeInfo::dispatchAnnounceMessage, this->getObjectID(), clientID, message);
         }
     }
@@ -422,5 +422,5 @@
                 this->dispatchKillMessage(message);
             else
-                callMemberNetworkFunction(GametypeInfo, dispatchKillMessage, this->getObjectID(), clientID, message);
+                callMemberNetworkFunction(&GametypeInfo::dispatchKillMessage, this->getObjectID(), clientID, message);
         }
     }
@@ -433,5 +433,5 @@
                 this->dispatchDeathMessage(message);
             else
-                callMemberNetworkFunction(GametypeInfo, dispatchDeathMessage, this->getObjectID(), clientID, message);
+                callMemberNetworkFunction(&GametypeInfo::dispatchDeathMessage, this->getObjectID(), clientID, message);
         }
     }
@@ -444,5 +444,5 @@
                 this->dispatchStaticMessage(message, colour);
             else
-                callMemberNetworkFunction(GametypeInfo, dispatchStaticMessage, this->getObjectID(), clientID, message, colour);
+                callMemberNetworkFunction(&GametypeInfo::dispatchStaticMessage, this->getObjectID(), clientID, message, colour);
         }
     }
@@ -455,5 +455,5 @@
                 this->dispatchFadingMessage(message);
             else
-                callMemberNetworkFunction(GametypeInfo, dispatchFadingMessage, this->getObjectID(), clientID, message);
+                callMemberNetworkFunction(&GametypeInfo::dispatchFadingMessage, this->getObjectID(), clientID, message);
         }
     }
Index: code/trunk/src/orxonox/infos/HumanPlayer.cc
===================================================================
--- code/trunk/src/orxonox/infos/HumanPlayer.cc	(revision 10622)
+++ code/trunk/src/orxonox/infos/HumanPlayer.cc	(revision 10624)
@@ -160,7 +160,7 @@
     }
 
-    void HumanPlayer::changedGametype()
-    {
-        PlayerInfo::changedGametype();
+    void HumanPlayer::switchGametype(Gametype* gametype)
+    {
+        PlayerInfo::switchGametype(gametype);
 
         if (this->isInitialized() && this->isLocalPlayer())
Index: code/trunk/src/orxonox/infos/HumanPlayer.h
===================================================================
--- code/trunk/src/orxonox/infos/HumanPlayer.h	(revision 10622)
+++ code/trunk/src/orxonox/infos/HumanPlayer.h	(revision 10624)
@@ -51,5 +51,5 @@
             void setClientID(unsigned int clientID);
 
-            virtual void changedGametype();
+            virtual void switchGametype(Gametype* gametype);
 
             inline void setHumanHUDTemplate(const std::string& name)
Index: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 10622)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 10624)
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(PlayerInfo).inheritsFrom(Class(Info));
+    RegisterAbstractClass(PlayerInfo).inheritsFrom<Info>();
 
     PlayerInfo::PlayerInfo(Context* context) : Info(context)
@@ -57,5 +57,5 @@
         this->gtinfo_ = 0;
         this->gtinfoID_ = OBJECTID_UNKNOWN;
-        this->updateGametypeInfo();
+        this->updateGametypeInfo(this->getGametype());
 
         this->registerVariables();
@@ -95,36 +95,41 @@
     }
 
-    void PlayerInfo::changedGametype()
-    {
-        this->updateGametypeInfo();
+    void PlayerInfo::switchGametype(Gametype* gametype)
+    {
+        Gametype* oldGametype = this->getGametype();
+        this->setGametype(StrongPtr<Gametype>(gametype));
+        Gametype* newGametype = this->getGametype();
+
+
+        this->updateGametypeInfo(newGametype);
 
         if (this->isInitialized())
         {
-            if (this->getOldGametype())
+            if (oldGametype)
             {
-                if (this->getGametype())
-                    this->getOldGametype()->playerSwitched(this, this->getGametype());
+                if (newGametype)
+                    oldGametype->playerSwitched(this, newGametype);
                 else
-                    this->getOldGametype()->playerLeft(this);
+                    oldGametype->playerLeft(this);
             }
 
-            if (this->getGametype())
+            if (newGametype)
             {
-                if (this->getOldGametype())
-                    this->getGametype()->playerSwitchedBack(this, this->getOldGametype());
+                if (oldGametype)
+                    newGametype->playerSwitchedBack(this, oldGametype);
                 else
-                    this->getGametype()->playerEntered(this);
+                    newGametype->playerEntered(this);
             }
         }
     }
 
-    void PlayerInfo::updateGametypeInfo()
+    void PlayerInfo::updateGametypeInfo(Gametype* gametype)
     {
         this->gtinfo_ = 0;
         this->gtinfoID_ = OBJECTID_UNKNOWN;
 
-        if (this->getGametype() && this->getGametype()->getGametypeInfo())
-        {
-            this->gtinfo_ = this->getGametype()->getGametypeInfo();
+        if (gametype && gametype->getGametypeInfo())
+        {
+            this->gtinfo_ = gametype->getGametypeInfo();
             this->gtinfoID_ = this->gtinfo_->getObjectID();
         }
@@ -186,5 +191,5 @@
 
         this->controllableEntity_->destroyHud(); // HACK-ish
-        this->previousControllableEntity_.push_back(WeakPtr<ControllableEntity>(this->controllableEntity_));
+        this->previousControllableEntity_.push_back(this->controllableEntity_);
         this->controllableEntity_ = entity;
         this->controllableEntityID_ = entity->getObjectID();
Index: code/trunk/src/orxonox/infos/PlayerInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.h	(revision 10622)
+++ code/trunk/src/orxonox/infos/PlayerInfo.h	(revision 10624)
@@ -45,5 +45,5 @@
 
             virtual void changedName();
-            virtual void changedGametype();
+            virtual void switchGametype(Gametype* gametype);
 
             virtual void changedController() {}
@@ -94,5 +94,5 @@
             void networkcallback_changedcontrollableentityID();
             void networkcallback_changedgtinfoID();
-            void updateGametypeInfo();
+            void updateGametypeInfo(Gametype* gametype);
 
             bool bReadyToSpawn_;
Index: code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 10624)
@@ -50,5 +50,5 @@
     // GametypeMessageListener
     //----------------------------
-    RegisterAbstractClass(GametypeMessageListener).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(GametypeMessageListener).inheritsFrom<OrxonoxInterface>();
 
     GametypeMessageListener::GametypeMessageListener()
@@ -60,5 +60,5 @@
     // PlayerTrigger
     //----------------------------
-    RegisterAbstractClass(PlayerTrigger).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(PlayerTrigger).inheritsFrom<OrxonoxInterface>();
 
     PlayerTrigger::PlayerTrigger()
@@ -72,7 +72,7 @@
     {
         assert(pawn);
-        this->pawn_ = WeakPtr<Pawn>(pawn);
+        this->pawn_ = pawn;
         if (pawn)
-            this->player_ = WeakPtr<PlayerInfo>(pawn->getPlayer());
+            this->player_ = pawn->getPlayer();
     }
 
@@ -80,5 +80,5 @@
     // RadarListener
     //----------------------------
-    RegisterAbstractClass(RadarListener).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(RadarListener).inheritsFrom<OrxonoxInterface>();
 
     RadarListener::RadarListener()
@@ -90,5 +90,5 @@
     // TeamColourable
     //----------------------------
-    RegisterAbstractClass(TeamColourable).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(TeamColourable).inheritsFrom<OrxonoxInterface>();
 
     TeamColourable::TeamColourable()
@@ -100,5 +100,5 @@
     // Rewardable
     //----------------------------
-    RegisterAbstractClass(Rewardable).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(Rewardable).inheritsFrom<OrxonoxInterface>();
 
     Rewardable::Rewardable()
Index: code/trunk/src/orxonox/interfaces/NotificationListener.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/NotificationListener.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/NotificationListener.cc	(revision 10624)
@@ -34,5 +34,5 @@
 #include "core/CoreIncludes.h"
 #include "network/Host.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 #include "util/SubString.h"
 
@@ -51,4 +51,6 @@
     registerStaticNetworkFunction(NotificationListener::sendHelper);
     
+    RegisterAbstractClass(NotificationListener).inheritsFrom<OrxonoxInterface>();
+
     NotificationListener::NotificationListener()
     {
@@ -82,10 +84,10 @@
         else if(GameMode::isServer() && sendMode == notificationSendMode::network && Host::getPlayerID() != clientId)
         {
-            callStaticNetworkFunction(NotificationListener::sendHelper, clientId, message, sender, isCommand, (unsigned int)messageType);
+            callStaticNetworkFunction(&NotificationListener::sendHelper, clientId, message, sender, isCommand, (unsigned int)messageType);
         }
         else if(GameMode::isServer() && sendMode == notificationSendMode::broadcast)
         {
             // TODO: Works as intended?
-            callStaticNetworkFunction(NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, (unsigned int)messageType);
+            callStaticNetworkFunction(&NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, (unsigned int)messageType);
         }
     }
Index: code/trunk/src/orxonox/interfaces/PickupCarrier.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupCarrier.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/PickupCarrier.cc	(revision 10624)
@@ -41,5 +41,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(PickupCarrier).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(PickupCarrier).inheritsFrom<OrxonoxInterface>();
 
     /**
Index: code/trunk/src/orxonox/interfaces/PickupListener.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupListener.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/PickupListener.cc	(revision 10624)
@@ -40,4 +40,5 @@
 namespace orxonox
 {
+    RegisterAbstractClass(PickupListener).inheritsFrom<OrxonoxInterface>();
 
     /**
Index: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc	(revision 10624)
@@ -46,5 +46,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(Pickupable).inheritsFrom(Class(OrxonoxInterface)).inheritsFrom(Class(Rewardable));
+    RegisterAbstractClass(Pickupable).inheritsFrom<OrxonoxInterface>().inheritsFrom<Rewardable>();
 
     /**
Index: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h	(revision 10624)
@@ -187,7 +187,7 @@
 
     //! SUPER functions.
-    SUPER_FUNCTION(10, Pickupable, changedUsed, false);
-    SUPER_FUNCTION(11, Pickupable, changedCarrier, false);
-    SUPER_FUNCTION(12, Pickupable, changedPickedUp, false);
+    SUPER_FUNCTION(9, Pickupable, changedUsed, false);
+    SUPER_FUNCTION(10, Pickupable, changedCarrier, false);
+    SUPER_FUNCTION(11, Pickupable, changedPickedUp, false);
 }
 
Index: code/trunk/src/orxonox/interfaces/PlayerTrigger.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PlayerTrigger.h	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/PlayerTrigger.h	(revision 10624)
@@ -63,5 +63,5 @@
         */
         inline Pawn* getTriggeringPawn(void) const
-            { return this->pawn_.get(); }
+            { return this->pawn_; }
 
         /**
Index: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 10624)
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(RadarViewable).inheritsFrom(Class(OrxonoxInterface));
+    RegisterAbstractClass(RadarViewable).inheritsFrom<OrxonoxInterface>();
 
     /**
Index: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 10622)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 10624)
@@ -37,5 +37,5 @@
 #include "util/Math.h"
 #include "core/class/OrxonoxInterface.h"
-#include "core/object/SmartPtr.h"
+#include "core/object/StrongPtr.h"
 
 namespace orxonox
@@ -163,5 +163,5 @@
         //Radar
         const WorldEntity* wePtr_;
-        SmartPtr<Radar> radar_;
+        StrongPtr<Radar> radar_;
         float radarObjectCamouflage_;
         Shape radarObjectShape_;
Index: code/trunk/src/orxonox/items/ShipPart.cc
===================================================================
--- code/trunk/src/orxonox/items/ShipPart.cc	(revision 10622)
+++ code/trunk/src/orxonox/items/ShipPart.cc	(revision 10624)
@@ -50,9 +50,8 @@
 
     ShipPart::ShipPart(Context* context)
-        : Item(context)
+        : Item(context), parent_(NULL)
     {
         RegisterObject(ShipPart);
-        this->setAlive(true);
-        this->setEventExecution(true);
+        this->eventExecution_ = true;
         this->healthMem_ = 100;
     }
@@ -60,5 +59,9 @@
     ShipPart::~ShipPart()
     {
-
+        if (this->parent_)
+        {
+            // Remove this ShipPart from the parent.
+            this->parent_->removeShipPart(this);
+        }
     }
 
@@ -86,9 +89,5 @@
     void ShipPart::death()
     {
-        //if (!(this->isAlive()))
-            //return;
-
         this->explode();
-        this->setAlive(false);
 
         if(eventExecution_)
@@ -101,7 +100,5 @@
         }
 
-        // Remove this ShipPart from the parent.
-        this->parent_->removeShipPart(this);
-        delete this;
+        this->destroyLater();
     }
 
@@ -203,10 +200,4 @@
     {
         this->health_ = health;
-    }
-
-    void ShipPart::setAlive(bool var)
-    {
-        this->alive_ = var;
-        orxout() << "ShipPart " << this->getName() << " alive_: " << this->alive_ << endl;
     }
 
@@ -240,6 +231,5 @@
         }
         if (this->health_ < 0)
-            this->alive_ = false;
-            //this->death();
+            this->death();
 
         // (Ugly) Chatoutput of health, until a GUI for modularspaceships-shipparts is implemented.
Index: code/trunk/src/orxonox/items/ShipPart.h
===================================================================
--- code/trunk/src/orxonox/items/ShipPart.h	(revision 10622)
+++ code/trunk/src/orxonox/items/ShipPart.h	(revision 10624)
@@ -72,8 +72,4 @@
                 { return this->parent_; }
 
-            void setAlive(bool var);
-            inline bool isAlive()
-                { return this->alive_; }
-
             inline void setEventExecution(bool var)
                 { this->eventExecution_ = var; }
@@ -121,5 +117,4 @@
             std::vector<PartDestructionEvent*> eventList_;  // The list of all PartDestructionEvent assigned to this ShipPart.
 
-            bool alive_;
             bool eventExecution_;
 
Index: code/trunk/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 10622)
+++ code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 10624)
@@ -45,10 +45,10 @@
 #include "util/Math.h"
 #include "util/DisplayStringConversions.h"
-#include "util/ScopedSingletonManager.h"
 #include "util/output/MemoryWriter.h"
 #include "util/output/OutputManager.h"
 #include "core/CoreIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "core/GUIManager.h"
 #include "core/input/InputManager.h"
@@ -65,5 +65,7 @@
     SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole);
 
-    ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
+    ManageScopedSingleton(InGameConsole, ScopeID::GRAPHICS, false);
+
+    RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>().inheritsFrom<UpdateListener>();
 
     /**
Index: code/trunk/src/orxonox/overlays/InGameConsole.h
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 10622)
+++ code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 10624)
@@ -39,8 +39,9 @@
 #include "core/WindowEventListener.h"
 #include "core/command/Shell.h"
+#include "core/UpdateListener.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
+    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener, public UpdateListener
     {
         friend class Singleton<InGameConsole>;
@@ -53,4 +54,5 @@
 
         void preUpdate(const Clock& time);
+        void postUpdate(const Clock& time) { /*no action*/ }
 
         static void openConsole();
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 10622)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 10624)
@@ -48,5 +48,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "OverlayGroup.h"
Index: code/trunk/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 10622)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 10624)
@@ -36,6 +36,7 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include "OrxonoxOverlay.h"
+#include "gametypes/Gametype.h"
 
 namespace orxonox
@@ -61,5 +62,5 @@
     OverlayGroup::~OverlayGroup()
     {
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->destroy();
         this->hudElements_.clear();
@@ -85,5 +86,5 @@
     void OverlayGroup::setScale(const Vector2& scale)
     {
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->scale(scale / this->scale_);
         this->scale_ = scale;
@@ -93,5 +94,5 @@
     void OverlayGroup::setScroll(const Vector2& scroll)
     {
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->scroll(scroll - this->scroll_);
         this->scroll_ = scroll;
@@ -106,5 +107,5 @@
     void OverlayGroup::addElement(OrxonoxOverlay* element)
     {
-        hudElements_.insert(SmartPtr<OrxonoxOverlay>(element));
+        hudElements_.insert(element);
         element->setOverlayGroup( this );
         if (this->owner_)
@@ -122,5 +123,5 @@
     bool OverlayGroup::removeElement(OrxonoxOverlay* element)
     {
-        if(this->hudElements_.erase(SmartPtr<OrxonoxOverlay>(element)) == 0)
+        if(this->hudElements_.erase(element) == 0)
             return false;
         return true;
@@ -132,8 +133,8 @@
         if (index < this->hudElements_.size())
         {
-            std::set< SmartPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
+            std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
             for (unsigned int i = 0; i != index; ++it, ++i)
                 ;
-            return it->get();
+            return *it;
         }
         else
@@ -146,22 +147,13 @@
         SUPER( OverlayGroup, changedVisibility );
 
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
     }
 
-    //! Changes the gametype of all elements
-    void OverlayGroup::changedGametype()
-    {
-        SUPER( OverlayGroup, changedGametype );
-
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
-            (*it)->setGametype(this->getGametype());
-    }
-
     void OverlayGroup::setOwner(BaseObject* owner)
     {
         this->owner_ = owner;
 
-        for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+        for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
             (*it)->setOwner(owner);
     }
Index: code/trunk/src/orxonox/overlays/OverlayGroup.h
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 10622)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 10624)
@@ -65,9 +65,8 @@
         static void scrollGroup(const std::string& name, const Vector2& scroll);
 
-        inline const std::set< SmartPtr<OrxonoxOverlay> >& getOverlays() const
+        inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const
             { return this->hudElements_; }
 
         virtual void changedVisibility();
-        virtual void changedGametype();
 
         void setOwner(BaseObject* owner);
@@ -92,5 +91,5 @@
 
     private:
-        std::set< SmartPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
+        std::set< StrongPtr<OrxonoxOverlay> > hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
         Vector2 scale_;                            //!< Current scale (independent of the elements).
         Vector2 scroll_;                           //!< Current scrolling offset.
Index: code/trunk/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/trunk/src/orxonox/sound/AmbientSound.cc	(revision 10622)
+++ code/trunk/src/orxonox/sound/AmbientSound.cc	(revision 10624)
@@ -36,4 +36,6 @@
 namespace orxonox
 {
+    RegisterAbstractClass(AmbientSound).inheritsFrom<BaseSound>().inheritsFrom<MoodListener>();
+
     AmbientSound::AmbientSound()
         : bPlayOnLoad_(false)
@@ -49,5 +51,5 @@
         if (GameMode::playsSound())
         {
-            // Smoothly fade out by keeping a SmartPtr
+            // Smoothly fade out by keeping a StrongPtr
             SoundManager::getInstance().unregisterAmbientSound(this);
         }
Index: code/trunk/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/trunk/src/orxonox/sound/BaseSound.cc	(revision 10622)
+++ code/trunk/src/orxonox/sound/BaseSound.cc	(revision 10624)
@@ -43,5 +43,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(BaseSound).inheritsFrom(Class(Listable));
+    RegisterAbstractClass(BaseSound).inheritsFrom<Listable>();
 
     BaseSound::BaseSound()
Index: code/trunk/src/orxonox/sound/SoundBuffer.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundBuffer.h	(revision 10622)
+++ code/trunk/src/orxonox/sound/SoundBuffer.h	(revision 10624)
@@ -46,5 +46,5 @@
         friend class SoundManager;
 #if !defined(_MSC_VER) || _MSC_VER >= 1500
-        // Make sure nobody deletes an instance (using smart pointers)
+        // Make sure nobody deletes an instance (using strong pointers)
         template <class T>
         friend void boost::checked_delete(T*);
Index: code/trunk/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.cc	(revision 10622)
+++ code/trunk/src/orxonox/sound/SoundManager.cc	(revision 10624)
@@ -38,5 +38,5 @@
 #include "util/Math.h"
 #include "util/Clock.h"
-#include "util/ScopedSingletonManager.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
 #include "core/CoreIncludes.h"
@@ -50,5 +50,5 @@
 namespace orxonox
 {
-    ManageScopedSingleton(SoundManager, ScopeID::Graphics, true);
+    ManageScopedSingleton(SoundManager, ScopeID::GRAPHICS, true);
 
     std::string SoundManager::getALErrorString(ALenum code)
@@ -65,4 +65,6 @@
         }
     }
+
+    RegisterAbstractClass(SoundManager).inheritsFrom<Configurable>().inheritsFrom<UpdateListener>();
 
     SoundManager::SoundManager()
@@ -163,5 +165,5 @@
     SoundManager::~SoundManager()
     {
-        // Erase fade lists because of the smart pointers
+        // Erase fade lists because of the strong pointers
         this->bDestructorCalled_ = true;
         this->fadeInList_.clear();
@@ -417,8 +419,8 @@
     }
 
-    void SoundManager::fadeIn(const SmartPtr<AmbientSound>& sound)
+    void SoundManager::fadeIn(AmbientSound* sound)
     {
         // If we're already fading out --> remove that
-        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
+        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
         {
             if (*it == sound)
@@ -433,8 +435,8 @@
     }
 
-    void SoundManager::fadeOut(const SmartPtr<AmbientSound>& sound)
+    void SoundManager::fadeOut(AmbientSound* sound)
     {
         // If we're already fading in --> remove that
-        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
+        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
         {
             if (*it == sound)
@@ -459,5 +461,5 @@
 
         // FADE IN
-        for (std::list<SmartPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
+        for (std::list<StrongPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
         {
             if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f)
@@ -474,5 +476,5 @@
 
         // FADE OUT
-        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
+        for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
         {
             if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f)
Index: code/trunk/src/orxonox/sound/SoundManager.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.h	(revision 10622)
+++ code/trunk/src/orxonox/sound/SoundManager.h	(revision 10624)
@@ -40,5 +40,6 @@
 #include "util/Singleton.h"
 #include "core/config/Configurable.h"
-#include "core/object/SmartPtr.h"
+#include "core/object/StrongPtr.h"
+#include "core/UpdateListener.h"
 
 // tolua_begin
@@ -59,5 +60,5 @@
     class _OrxonoxExport SoundManager
     // tolua_end
-        : public Singleton<SoundManager>, public Configurable
+        : public Singleton<SoundManager>, public Configurable, public UpdateListener
     { // tolua_export
         friend class Singleton<SoundManager>;
@@ -68,4 +69,5 @@
 
         void preUpdate(const Clock& time);
+        void postUpdate(const Clock& time) { /*no action*/ }
         void setConfigValues();
 
@@ -104,6 +106,6 @@
     private:
         void processCrossFading(float dt);
-        void fadeIn(const SmartPtr<AmbientSound>& sound);
-        void fadeOut(const SmartPtr<AmbientSound>& sound);
+        void fadeIn(AmbientSound* sound);
+        void fadeOut(AmbientSound* sound);
 
         void checkFadeStepValidity();
@@ -127,6 +129,6 @@
         //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
         float                              crossFadeStep_;
-        std::list<SmartPtr<AmbientSound> > fadeInList_;
-        std::list<SmartPtr<AmbientSound> > fadeOutList_;
+        std::list<StrongPtr<AmbientSound> > fadeInList_;
+        std::list<StrongPtr<AmbientSound> > fadeOutList_;
 
         // Volume related
Index: code/trunk/src/orxonox/sound/WorldAmbientSound.cc
===================================================================
--- code/trunk/src/orxonox/sound/WorldAmbientSound.cc	(revision 10622)
+++ code/trunk/src/orxonox/sound/WorldAmbientSound.cc	(revision 10624)
@@ -33,5 +33,5 @@
 #include "core/XMLPort.h"
 #include "AmbientSound.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 #include <exception>
 
Index: code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 10622)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 10624)
@@ -45,5 +45,5 @@
 namespace orxonox
 {
-    RegisterAbstractClass(WeaponMode).inheritsFrom(Class(BaseObject));
+    RegisterAbstractClass(WeaponMode).inheritsFrom<BaseObject>();
 
     WeaponMode::WeaponMode(Context* context) : BaseObject(context)
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 10624)
@@ -36,5 +36,5 @@
 #include "core/GameMode.h"
 #include "core/XMLPort.h"
-#include "network/NetworkFunction.h"
+#include "network/NetworkFunctionIncludes.h"
 
 #include "Scene.h"
@@ -108,5 +108,5 @@
                 this->camera_->destroy();
 
-            for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+            for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
                 (*it)->destroy();
 
@@ -165,5 +165,5 @@
     {
         unsigned int i = 0;
-        for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+        for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
         {
             if (i == index)
@@ -180,5 +180,5 @@
 
         unsigned int counter = 0;
-        for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+        for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
         {
             if ((*it) == this->currentCameraPosition_)
@@ -215,9 +215,9 @@
             {
                 this->cameraPositions_.front()->attachCamera(this->camera_);
-                this->currentCameraPosition_ = this->cameraPositions_.front().get();
+                this->currentCameraPosition_ = this->cameraPositions_.front();
             }
             else if (this->cameraPositions_.size() > 0)
             {
-                for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+                for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
                 {
                     if ((*it) == this->camera_->getParent())
@@ -307,5 +307,5 @@
         else
         {
-            callMemberNetworkFunction(ControllableEntity, fire, this->getObjectID(), 0, firemode);
+            callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode);
         }
     }
@@ -323,9 +323,9 @@
             if ( target != 0 )
             {
-                callMemberNetworkFunction(ControllableEntity, setTargetInternal, this->getObjectID(), 0, target->getObjectID() );
+                callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, target->getObjectID() );
             }
            else
            {
-                callMemberNetworkFunction(ControllableEntity, setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN );
+                callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN );
            }
         }
@@ -477,5 +477,5 @@
         if (parent)
         {
-            for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+            for (std::list<StrongPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
                 if ((*it)->getIsAbsolute())
                     parent->attach((*it));
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 10624)
@@ -121,5 +121,5 @@
             void addCameraPosition(CameraPosition* position);
             CameraPosition* getCameraPosition(unsigned int index) const;
-            inline const std::list<SmartPtr<CameraPosition> >& getCameraPositions() const
+            inline const std::list<StrongPtr<CameraPosition> >& getCameraPositions() const
                 { return this->cameraPositions_; }
             unsigned int getCurrentCameraIndex() const;
@@ -162,5 +162,5 @@
 
             inline Controller* getController() const
-                { return this->controller_.get(); }
+                { return this->controller_; }
             void setController(Controller* val);
 
@@ -168,5 +168,5 @@
             virtual void setTarget( WorldEntity* target );
             virtual WorldEntity* getTarget()
-                { return this->target_.get(); }
+                { return this->target_; }
             void setTargetInternal( uint32_t targetID );
 
@@ -242,5 +242,5 @@
             bool bMouseLook_;
             float mouseLookSpeed_;
-            std::list<SmartPtr<CameraPosition> > cameraPositions_;
+            std::list<StrongPtr<CameraPosition> > cameraPositions_;
             CameraPosition* currentCameraPosition_;
             std::string cameraPositionTemplate_;
Index: code/trunk/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/WorldEntity.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/WorldEntity.cc	(revision 10624)
@@ -61,5 +61,5 @@
     BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World);
 
-    RegisterAbstractClass(WorldEntity).inheritsFrom(Class(BaseObject)).inheritsFrom(Class(Synchronisable));
+    RegisterAbstractClass(WorldEntity).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>();
 
     /**
@@ -130,5 +130,5 @@
                 WorldEntity* entity = *it;
 
-                // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to smart pointers pointing to it
+                // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to strong pointers pointing to it
                 entity->setPosition(entity->getWorldPosition());
                 this->detach(entity); // detach also erases the element from the children set
Index: code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc	(revision 10624)
@@ -40,5 +40,5 @@
         RegisterObject(Destroyer);
 
-        UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype().get());
+        UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype());
         if (gametype)
         {
Index: code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	(revision 10624)
@@ -37,5 +37,5 @@
 #include "util/Math.h"
 #include "gametypes/Gametype.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "items/ShipPart.h"
@@ -69,5 +69,6 @@
         if (this->isInitialized())
         {
-
+            while (!this->partList_.empty())
+                this->partList_[0]->destroy();
         }
     }
@@ -177,5 +178,5 @@
             if (it->second->getName() == name)
             {
-                it->second->setAlive(false);
+                it->second->death();
                 return;
             }
@@ -196,5 +197,5 @@
             if (it->second->getName() == name)
             {
-                it->second->setAlive(false);
+                it->second->death();
                 return;
             }
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10624)
@@ -326,6 +326,7 @@
         if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
         {
-            // Set bAlive_ to false and wait for PawnManager to do the destruction
+            // Set bAlive_ to false and wait for destroyLater() to do the destruction
             this->bAlive_ = false;
+            this->destroyLater();
 
             this->setDestroyWhenPlayerLeft(false);
Index: code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Spectator.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/pawns/Spectator.cc	(revision 10624)
@@ -34,5 +34,5 @@
 #include "core/GameMode.h"
 #include "core/command/CommandExecutor.h"
-#include "core/command/ConsoleCommand.h"
+#include "core/command/ConsoleCommandIncludes.h"
 
 #include "tools/BillboardSet.h"
Index: code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	(revision 10622)
+++ code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	(revision 10624)
@@ -45,5 +45,5 @@
         this->state_ = BaseState::Uncontrolled;
 
-        TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype().get());
+        TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype());
         if (gametype)
         {
@@ -58,5 +58,5 @@
         this->fireEvent();
 
-        TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype().get());
+        TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype());
         if (!gametype)
             return;
