Index: sandbox/src/libraries/core/CMakeLists.txt
===================================================================
--- sandbox/src/libraries/core/CMakeLists.txt	(revision 5782)
+++ sandbox/src/libraries/core/CMakeLists.txt	(revision 6038)
@@ -19,6 +19,4 @@
 
 SET_SOURCE_FILES(CORE_SRC_FILES
-  Clock.cc
-  ConfigFileManager.cc
   ConfigValueContainer.cc
   Core.cc
@@ -33,9 +31,8 @@
 
   # command
-  CommandLine.cc
+  CommandLineParser.cc
   Executor.cc
 
   # hierarchy
-  Factory.cc
   Identifier.cc
   MetaObjectList.cc
@@ -43,4 +40,9 @@
   # level
   BaseObject.cc
+
+COMPILATION_BEGIN FilesystemCompilation.cc
+  ConfigFileManager.cc
+  PathConfig.cc
+COMPILATION_END
 
   # multithreading
Index: sandbox/src/libraries/core/ClassFactory.h
===================================================================
--- sandbox/src/libraries/core/ClassFactory.h	(revision 5782)
+++ sandbox/src/libraries/core/ClassFactory.h	(revision 6038)
@@ -42,9 +42,19 @@
 
 #include "util/Debug.h"
-#include "Factory.h"
 #include "Identifier.h"
 
 namespace orxonox
 {
+    // ###########################
+    // ###       Factory       ###
+    // ###########################
+    //! Base-class of ClassFactory.
+    class _CoreExport Factory
+    {
+        public:
+            virtual ~Factory() {};
+            virtual BaseObject* fabricate(BaseObject* creator) = 0;
+    };
+
     // ###############################
     // ###      ClassFactory       ###
@@ -52,53 +62,27 @@
     //! The ClassFactory is able to create new objects of a specific class.
     template <class T>
-    class ClassFactory : public BaseFactory
+    class ClassFactory : public Factory
     {
         public:
-            static bool create(const std::string& name);
-            BaseObject* fabricate(BaseObject* creator);
+            /**
+                @brief Constructor: Adds the ClassFactory to the Identifier of the same type.
+                @param name The name of the class
+                @param bLoadable True if the class can be loaded through XML
+            */
+            ClassFactory(const std::string& name, bool bLoadable = true)
+            {
+                COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
+                ClassIdentifier<T>::getIdentifier(name)->addFactory(this);
+            }
 
-        private:
-            ClassFactory() {}                               // Don't create
-            ClassFactory(const ClassFactory& factory) {}    // Don't copy
-            virtual ~ClassFactory() {}                      // Don't delete
-
-            static T* createNewObject(BaseObject* creator);
+            /**
+                @brief Creates and returns a new object of class T.
+                @return The new object
+            */
+            inline BaseObject* fabricate(BaseObject* creator)
+            {
+                return static_cast<BaseObject*>(new T(creator));
+            }
     };
-
-    /**
-        @brief Adds the ClassFactory to the Identifier of the same type and the Identifier to the Factory.
-        @param name The name of the class
-        @param bLoadable True if the class can be loaded through XML
-        @return Always true (this is needed because the compiler only allows assignments before main())
-    */
-    template <class T>
-    bool ClassFactory<T>::create(const std::string& name)
-    {
-        COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
-        ClassIdentifier<T>::getIdentifier(name)->addFactory(new ClassFactory<T>);
-        Factory::add(name, ClassIdentifier<T>::getIdentifier());
-
-        return true;
-    }
-
-    /**
-        @brief Creates and returns a new object of class T.
-        @return The new object
-    */
-    template <class T>
-    inline BaseObject* ClassFactory<T>::fabricate(BaseObject* creator)
-    {
-        return ClassFactory<T>::createNewObject(creator);
-    }
-
-    /**
-        @brief Creates and returns a new object of class T; this is a wrapper for the new operator.
-        @return The new object
-    */
-    template <class T>
-    inline T* ClassFactory<T>::createNewObject(BaseObject* creator)
-    {
-        return new T(creator);
-    }
 }
 
Index: sandbox/src/libraries/core/Clock.cc
===================================================================
--- sandbox/src/libraries/core/Clock.cc	(revision 5782)
+++ 	(revision )
@@ -1,78 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief
-*/
-
-#include "Clock.h"
-#include <OgreTimer.h>
-
-namespace orxonox
-{
-    Clock::Clock()
-        : timer_(new Ogre::Timer())
-        , storedTime_(0)
-        , tickTime_(0)
-        , tickDt_(0)
-        , tickDtFloat_(0.0f)
-        , lastTimersTime_(0)
-    {
-    }
-
-    Clock::~Clock()
-    {
-        delete timer_;
-    }
-    
-    void Clock::capture()
-    {
-        unsigned long timersTime = timer_->getMicroseconds();
-        tickTime_ = storedTime_ + timersTime;
-        tickDt_ = timersTime - lastTimersTime_;
-        tickDtFloat_ = static_cast<float>(tickDt_) / 1000000.0f;
-
-        if (timersTime > 0xFFFFFFFF/4)
-        {
-            // Ogre timer will overflow at 2^32 microseconds if unsigned long is 32 bit
-            storedTime_ += timersTime;
-            lastTimersTime_ = 0;
-            timer_->reset();
-        }
-        else
-        {
-            lastTimersTime_ = timersTime;
-        }
-    }
-
-    unsigned long long Clock::getRealMicroseconds() const
-    {
-        return this->timer_->getMicroseconds() + this->storedTime_;
-    }
-}
Index: sandbox/src/libraries/core/Clock.h
===================================================================
--- sandbox/src/libraries/core/Clock.h	(revision 5782)
+++ 	(revision )
@@ -1,68 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Clock_H__
-#define _Clock_H__
-
-#include "CorePrereqs.h"
-
-namespace Ogre { class Timer; }
-
-namespace orxonox
-{
-    class _CoreExport Clock
-    {
-    public:
-        Clock();
-        ~Clock();
-
-        void capture();
-
-        unsigned long long getMicroseconds()   const { return tickTime_; }
-        unsigned long long getMilliseconds()   const { return tickTime_ / 1000; }
-        unsigned long      getSeconds()        const { return static_cast<long> (tickTime_ / 1000000); }
-        float              getSecondsPrecise() const { return static_cast<float>(tickTime_ / 1000000.0f); }
-
-        float              getDeltaTime()      const { return tickDtFloat_; }
-        long               getDeltaTimeMicroseconds() const { return tickDt_; }
-
-        unsigned long long getRealMicroseconds() const;
-
-    private:
-        Clock(const Clock& instance);
-
-        Ogre::Timer*       timer_;
-        unsigned long long storedTime_;
-        unsigned long long tickTime_;
-        long               tickDt_;
-        float              tickDtFloat_;
-        unsigned long      lastTimersTime_;
-    };
-}
-
-#endif /* _Clock_H__ */
Index: sandbox/src/libraries/core/CommandLine.cc
===================================================================
--- sandbox/src/libraries/core/CommandLine.cc	(revision 5782)
+++ 	(revision )
@@ -1,378 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "CommandLine.h"
-
-#include <algorithm>
-#include <sstream>
-#include <boost/filesystem.hpp>
-
-#include "util/Convert.h"
-#include "util/Debug.h"
-#include "util/Exception.h"
-#include "util/StringUtils.h"
-#include "util/SubString.h"
-#include "Core.h"
-
-namespace orxonox
-{
-    SetCommandLineOnlyArgument(optionsFile, "start.ini").shortcut("o");
-
-    /**
-    @brief
-        Parses a value string for a command line argument.
-        It simply uses convertValue(Output, Input) to do that.
-        Bools are treated specially. That is necessary
-        so that you can have simple command line switches.
-    */
-    void CommandLineArgument::parse(const std::string& value, bool bParsingFile)
-    {
-        if (bParsingFile && this->bCommandLineOnly_)
-            ThrowException(Argument, "Command line argument '" + getName() + "' is not allowed in files.");
-        if (value_.getType() == MT_Type::Bool)
-        {
-            // simulate command line switch
-            bool temp;
-            if (convertValue(&temp, value))
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = temp;
-            }
-            else if (value == "")
-            {
-                this->bHasDefaultValue_ = false;
-                this->value_ = true;
-            }
-            else
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-        }
-        else
-        {
-            if (!value_.setValue(value))
-            {
-                value_.setValue(defaultValue_);
-                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
-            }
-            else
-                this->bHasDefaultValue_ = false;
-        }
-    }
-
-
-    /**
-    @brief
-        Destructor destroys all CommandLineArguments with it.
-    */
-    CommandLine::~CommandLine()
-    {
-        CommandLine::destroyAllArguments();
-    }
-
-    /**
-    @brief
-        Returns a unique instance (Meyers Singleton).
-    */
-    CommandLine& CommandLine::_getInstance()
-    {
-        static CommandLine instance;
-        return instance;
-    }
-
-    /**
-    @brief
-        Destroys all command line arguments. This should be called at the end
-        of main. Do not use before that.
-    */
-    void CommandLine::destroyAllArguments()
-    {
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
-            it != _getInstance().cmdLineArgs_.end(); ++it)
-            delete it->second;
-        _getInstance().cmdLineArgs_.clear();
-    }
-
-    /**
-    @brief
-        Reads the command line parses the values of each argument.
-        It is then stored in the corresponding CommandLineArgument.
-    @note
-        The reason that you have to provide the string to be parsed as
-        space separted list is because of argc and argv. If you only have
-        a whole string, simply use getAllStrings() of SubString.
-    @param arguments
-        Vector of space separated strings.
-    */
-    void CommandLine::_parse(const std::vector<std::string>& arguments, bool bParsingFile)
-    {
-        try
-        {
-            // why this? See bFirstTimeParse_ declaration.
-            if (bFirstTimeParse_)
-            {
-                // first shove all the shortcuts in a map
-                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
-                    it != cmdLineArgs_.end(); ++it)
-                {
-                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
-                        "Cannot have two command line shortcut with the same name.");
-                    if (it->second->getShortcut() != "")
-                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
-                }
-                bFirstTimeParse_ = false;
-            }
-
-            std::string name;
-            std::string shortcut;
-            std::string value;
-            for (unsigned int i = 0; i < arguments.size(); ++i)
-            {
-                if (arguments[i].size() != 0)
-                {
-                    // sure not ""
-                    if (arguments[i][0] == '-')
-                    {
-                        // start with "-"
-                        if (arguments[i].size() == 1)
-                        {
-                            // argument[i] is "-", probably a minus sign
-                            value += "- ";
-                        }
-                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
-                        {
-                            // negative number as a value
-                            value += arguments[i] + " ";
-                        }
-                        else
-                        {
-                            // can be shortcut or full name argument
-
-                            // save old data first
-                            value = removeTrailingWhitespaces(value);
-                            if (name != "")
-                            {
-                                checkFullArgument(name, value, bParsingFile);
-                                name = "";
-                                assert(shortcut == "");
-                            }
-                            else if (shortcut != "")
-                            {
-                                checkShortcut(shortcut, value, bParsingFile);
-                                shortcut = "";
-                                assert(name == "");
-                            }
-
-                            if (arguments[i][1] == '-')
-                            {
-                                // full name argument with "--name"
-                                name = arguments[i].substr(2);
-                            }
-                            else
-                            {
-                                // shortcut with "-s"
-                                shortcut = arguments[i].substr(1);
-                            }
-
-                            // reset value string
-                            value = "";
-                        }
-                    }
-                    else
-                    {
-                        // value string
-
-                        if (name == "" && shortcut == "")
-                        {
-                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
-                        }
-
-                        // Concatenate strings as long as there's no new argument by "-" or "--"
-                        value += arguments[i] + ' ';
-                    }
-                }
-            }
-
-            // parse last argument
-            value = removeTrailingWhitespaces(value);
-            if (name != "")
-            {
-                checkFullArgument(name, value, bParsingFile);
-                assert(shortcut == "");
-            }
-            else if (shortcut != "")
-            {
-                checkShortcut(shortcut, value, bParsingFile);
-                assert(name == "");
-            }
-        }
-        catch (const ArgumentException& ex)
-        {
-            COUT(0) << "Could not parse command line (including additional files): " << ex.what() << std::endl;
-            COUT(0) << CommandLine::getUsageInformation() << std::endl;
-            throw GeneralException("");
-        }
-    }
-
-    /**
-    @brief
-        Parses an argument based on its full name.
-    @param name
-        Full name of the argument
-    @param value
-        String containing the value
-    */
-    void CommandLine::checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
-        if (it == cmdLineArgs_.end())
-            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
-
-        it->second->parse(value, bParsingFile);
-    }
-
-    /**
-    @brief
-        Parses an argument based on its shortcut.
-    @param shortcut
-        Shotcut to the argument
-    @param value
-        String containing the value
-    */
-    void CommandLine::checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
-        if (it == cmdLineArgsShortcut_.end())
-            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
-
-        it->second->parse(value, bParsingFile);
-    }
-
-    std::string CommandLine::getUsageInformation()
-    {
-        CommandLine& inst = _getInstance();
-        std::ostringstream infoStr;
-
-        // determine maximum name size
-        size_t maxNameSize = 0;
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
-        }
-
-        infoStr << "Usage: orxonox [options]" << std::endl;
-        infoStr << "Available options:" << std::endl;
-
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
-        {
-            if (it->second->getShortcut() != "")
-                infoStr << " [-" << it->second->getShortcut() << "] ";
-            else
-                infoStr << "      ";
-            infoStr << "--" << it->second->getName() << " ";
-            if (it->second->getValue().getType() != MT_Type::Bool)
-                infoStr << "ARG ";
-            else
-                infoStr << "    ";
-            // fill with the necessary amount of blanks
-            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
-            infoStr << ": " << it->second->getInformation();
-            infoStr << std::endl;
-        }
-        return infoStr.str();
-    }
-
-    /**
-    @brief
-        Retrieves a CommandLineArgument.
-        The method throws an exception if 'name' was not found or the value could not be converted.
-    @note
-        You shold of course not call this method before the command line has been parsed.
-    */
-    const CommandLineArgument* CommandLine::getArgument(const std::string& name)
-    {
-        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-        if (it == _getInstance().cmdLineArgs_.end())
-        {
-            ThrowException(Argument, "Could find command line argument '" + name + "'.");
-        }
-        else
-        {
-            return it->second;
-        }
-    }
-
-    /**
-    @brief
-        Parses only the command line for CommandLineArguments.
-    */
-    void CommandLine::_parseCommandLine(const std::string& cmdLine)
-    {
-        std::vector<std::string> args;
-        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '(', ')', false);
-        for (unsigned i = 0; i < tokens.size(); ++i)
-            args.push_back(tokens[i]);
-        this->_parse(args, false);
-    }
-
-    /**
-    @brief
-        Parses start.ini (or the file specified with --optionsFile) for CommandLineArguments.
-    */
-    void CommandLine::_parseFile()
-    {
-        std::string filename = CommandLine::getValue("optionsFile").getString();
-        boost::filesystem::path filepath(Core::getConfigPath() / filename);
-
-        // look for additional arguments in given file or start.ini as default
-        // They will not overwrite the arguments given directly
-        std::ifstream file;
-        file.open(filepath.string().c_str());
-        std::vector<std::string> args;
-        if (file)
-        {
-            while (!file.eof())
-            {
-                std::string line;
-                std::getline(file, line);
-                line = removeTrailingWhitespaces(line);
-                //if (!(line[0] == '#' || line[0] == '%'))
-                //{
-                SubString tokens(line, " ", " ", false, '\\', true, '"', true, '(', ')', false, '#');
-                for (unsigned i = 0; i < tokens.size(); ++i)
-                    if (tokens[i][0] != '#')
-                        args.push_back(tokens[i]);
-                //args.insert(args.end(), tokens.getAllStrings().begin(), tokens.getAllStrings().end());
-                //}
-            }
-            file.close();
-        }
-
-        _parse(args, true);
-    }
-}
Index: sandbox/src/libraries/core/CommandLine.h
===================================================================
--- sandbox/src/libraries/core/CommandLine.h	(revision 5782)
+++ 	(revision )
@@ -1,223 +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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _CommandLine_H__
-#define _CommandLine_H__
-
-#include "CorePrereqs.h"
-
-#include <map>
-#include "util/OrxAssert.h"
-#include "util/MultiType.h"
-
-#define SetCommandLineArgument(name, defaultValue) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, defaultValue, false)
-#define SetCommandLineOnlyArgument(name, defaultValue) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, defaultValue, true)
-#define SetCommandLineSwitch(name) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, false, false)
-#define SetCommandLineOnlySwitch(name) \
-    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
-    = orxonox::CommandLine::addArgument(#name, false, true)
-
-
-namespace orxonox
-{
-    /**
-    @brief
-        Container class for a command line argument of any type supported by MultiType.
-
-        Whenever you want to have an option specified by a command line switch,
-        you need to first define it with SetCommandLineArgument(name, defaultValue).
-        It is then added to a map and possibly changed when the command line is being parsed.
-        If the option was not given, you can detect this by asking hasDefaultValue().
-
-        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
-        Note the difference between "-" and "--"!
-        Also, there is no restriction to the number of strings you add after --name.
-        So "--startVector (2, 4, 5)" is perfectly legal.
-
-        Retrieving an argument is possible with the getCommandLineArgument function of the
-        CommandLine class. It is a Singleton, but the public interface is static.
-    */
-    class _CoreExport CommandLineArgument
-    {
-        friend class CommandLine;
-
-    public:
-        //! Tells whether the value has been changed by the command line.
-        bool hasDefaultValue() const { return bHasDefaultValue_; }
-        //! Returns the name of the argument.
-        const std::string& getName() const { return name_; }
-
-        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
-        //! Evaluates to "" if there is none.
-        const std::string& getShortcut() const { return shortcut_; }
-        //! Sets the shortcut for the argument
-        CommandLineArgument& shortcut(const std::string& shortcut)
-        { this->shortcut_ = shortcut; return *this; }
-
-        //! Returns the usage information
-        const std::string& getInformation() const { return this->usageInformation_; }
-        //! Sets the option information when displaying orxonox usage.
-        CommandLineArgument& information(const std::string& usage)
-        { this->usageInformation_ = usage; return *this; }
-
-        //! Returns the actual value of the argument. Can be equal to default value.
-        MultiType getValue() const { return value_; }
-        //! Returns the given default value as type T.
-        MultiType getDefaultValue() const { return defaultValue_; }
-
-    private:
-        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
-        CommandLineArgument(const std::string& name, const MultiType& defaultValue, bool bCommandLineOnly)
-            : bHasDefaultValue_(true)
-            , name_(name)
-            , value_(defaultValue)
-            , defaultValue_(defaultValue)
-            , bCommandLineOnly_(bCommandLineOnly)
-        { }
-
-        //! Undefined copy constructor
-        CommandLineArgument(const CommandLineArgument& instance);
-        ~CommandLineArgument() { }
-
-        //! Parses the value string of a command line argument.
-        void parse(const std::string& value, bool bParsingFile);
-
-        //! Tells whether the value has been changed by the command line.
-        bool bHasDefaultValue_;
-
-    private:
-        std::string name_;             //!< Name of the argument
-        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
-        std::string usageInformation_; //!< Tells about the usage of this parameter
-
-        MultiType   value_;            //!< The actual value
-        MultiType   defaultValue_;     //!< Default value. Should not be changed.
-        bool        bCommandLineOnly_; //!< Whether you cannot specify the value in a text file
-    };
-
-
-    /**
-    @brief
-        Global interface to command line options.
-        Allows to add and retrieve command line arguments. Also does the parsing.
-    @note
-        Internally it is a Singleton, but the public interface is static.
-    @see
-        CommandLineArgument
-    */
-    class _CoreExport CommandLine
-    {
-    public:
-
-        //! Parse redirection to internal member method.
-        static void parseCommandLine(const std::string& cmdLine) { _getInstance()._parseCommandLine(cmdLine); }
-        static void parseFile() { _getInstance()._parseFile(); }
-
-        static std::string getUsageInformation();
-
-        static const CommandLineArgument* getArgument(const std::string& name);
-        //! Writes the argument value in the given parameter.
-        template <class T>
-        static void getValue(const std::string& name, T* value)
-        { *value = (T)(getArgument(name)->getValue()); }
-        static MultiType getValue(const std::string& name)
-        { return getArgument(name)->getValue(); }
-        template <class T>
-        static CommandLineArgument& addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly);
-
-        static bool existsArgument(const std::string& name)
-        {
-            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
-            return !(it == _getInstance().cmdLineArgs_.end());
-        }
-
-        static void destroyAllArguments();
-
-    private:
-        //! Constructor initialises bFirstTimeParse_ with true.
-        CommandLine() : bFirstTimeParse_(true) { }
-        //! Undefined copy constructor
-        CommandLine(const CommandLine& instance);
-        ~CommandLine();
-
-        static CommandLine& _getInstance();
-
-        void _parseCommandLine(const std::string& cmdLine);
-        void _parseFile();
-        void _parse(const std::vector<std::string>& arguments, bool bParsingFile);
-        void checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile);
-        void checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile);
-
-        /**
-            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
-            So when we call parse() the first time, we need to create a map with all shortcuts since these
-            get added after addCommandLineArgument().
-        */
-        bool bFirstTimeParse_;
-
-        //! Holds all pointers to the arguments and serves as a search map by name.
-        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
-        //! Search map by shortcut for the arguments.
-        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
-    };
-
-    template <>
-    inline void CommandLine::getValue<std::string>(const std::string& name, std::string* value)
-    {
-        *value = getArgument(name)->getValue().getString();
-    }
-
-    /**
-    @brief
-        Adds a new CommandLineArgument to the internal map.
-        Note that only such arguments are actually valid.
-    @param name
-        Name of the argument. Shortcut can be added later.
-    @param defaultValue
-        Default value that is used when argument was not given.
-    */
-    template <class T>
-    CommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly)
-    {
-        OrxAssert(!_getInstance().existsArgument(name),
-            "Cannot add a command line argument with name '" + name + "' twice.");
-        OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
-               "Boolean command line arguments with positive default values are not supported." << std::endl
-            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
-
-        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue, bCommandLineOnly));
-    }
-}
-
-#endif /* _CommandLine_H__ */
Index: sandbox/src/libraries/core/CommandLineParser.cc
===================================================================
--- sandbox/src/libraries/core/CommandLineParser.cc	(revision 6038)
+++ sandbox/src/libraries/core/CommandLineParser.cc	(revision 6038)
@@ -0,0 +1,377 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CommandLineParser.h"
+
+#include <algorithm>
+#include <sstream>
+
+#include "util/Convert.h"
+#include "util/Debug.h"
+#include "util/Exception.h"
+#include "util/StringUtils.h"
+#include "util/SubString.h"
+#include "PathConfig.h"
+
+namespace orxonox
+{
+    SetCommandLineOnlyArgument(optionsFile, "start.ini").shortcut("o");
+
+    /**
+    @brief
+        Parses a value string for a command line argument.
+        It simply uses convertValue(Output, Input) to do that.
+        Bools are treated specially. That is necessary
+        so that you can have simple command line switches.
+    */
+    void CommandLineArgument::parse(const std::string& value, bool bParsingFile)
+    {
+        if (bParsingFile && this->bCommandLineOnly_)
+            ThrowException(Argument, "Command line argument '" + getName() + "' is not allowed in files.");
+        if (value_.getType() == MT_Type::Bool)
+        {
+            // simulate command line switch
+            bool temp;
+            if (convertValue(&temp, value))
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = temp;
+            }
+            else if (value == "")
+            {
+                this->bHasDefaultValue_ = false;
+                this->value_ = true;
+            }
+            else
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+        }
+        else
+        {
+            if (!value_.setValue(value))
+            {
+                value_.setValue(defaultValue_);
+                ThrowException(Argument, "Could not read command line argument '" + getName() + "'.");
+            }
+            else
+                this->bHasDefaultValue_ = false;
+        }
+    }
+
+
+    /**
+    @brief
+        Destructor destroys all CommandLineArguments with it.
+    */
+    CommandLineParser::~CommandLineParser()
+    {
+        CommandLineParser::destroyAllArguments();
+    }
+
+    /**
+    @brief
+        Returns a unique instance (Meyers Singleton).
+    */
+    CommandLineParser& CommandLineParser::_getInstance()
+    {
+        static CommandLineParser instance;
+        return instance;
+    }
+
+    /**
+    @brief
+        Destroys all command line arguments. This should be called at the end
+        of main. Do not use before that.
+    */
+    void CommandLineParser::destroyAllArguments()
+    {
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();
+            it != _getInstance().cmdLineArgs_.end(); ++it)
+            delete it->second;
+        _getInstance().cmdLineArgs_.clear();
+    }
+
+    /**
+    @brief
+        Reads the command line parses the values of each argument.
+        It is then stored in the corresponding CommandLineArgument.
+    @note
+        The reason that you have to provide the string to be parsed as
+        space separted list is because of argc and argv. If you only have
+        a whole string, simply use getAllStrings() of SubString.
+    @param arguments
+        Vector of space separated strings.
+    */
+    void CommandLineParser::_parse(const std::vector<std::string>& arguments, bool bParsingFile)
+    {
+        try
+        {
+            // why this? See bFirstTimeParse_ declaration.
+            if (bFirstTimeParse_)
+            {
+                // first shove all the shortcuts in a map
+                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
+                    it != cmdLineArgs_.end(); ++it)
+                {
+                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
+                        "Cannot have two command line shortcut with the same name.");
+                    if (it->second->getShortcut() != "")
+                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
+                }
+                bFirstTimeParse_ = false;
+            }
+
+            std::string name;
+            std::string shortcut;
+            std::string value;
+            for (unsigned int i = 0; i < arguments.size(); ++i)
+            {
+                if (arguments[i].size() != 0)
+                {
+                    // sure not ""
+                    if (arguments[i][0] == '-')
+                    {
+                        // start with "-"
+                        if (arguments[i].size() == 1)
+                        {
+                            // argument[i] is "-", probably a minus sign
+                            value += "- ";
+                        }
+                        else if (arguments[i][1] <= 57 && arguments[i][1] >= 48)
+                        {
+                            // negative number as a value
+                            value += arguments[i] + " ";
+                        }
+                        else
+                        {
+                            // can be shortcut or full name argument
+
+                            // save old data first
+                            value = removeTrailingWhitespaces(value);
+                            if (name != "")
+                            {
+                                checkFullArgument(name, value, bParsingFile);
+                                name = "";
+                                assert(shortcut == "");
+                            }
+                            else if (shortcut != "")
+                            {
+                                checkShortcut(shortcut, value, bParsingFile);
+                                shortcut = "";
+                                assert(name == "");
+                            }
+
+                            if (arguments[i][1] == '-')
+                            {
+                                // full name argument with "--name"
+                                name = arguments[i].substr(2);
+                            }
+                            else
+                            {
+                                // shortcut with "-s"
+                                shortcut = arguments[i].substr(1);
+                            }
+
+                            // reset value string
+                            value = "";
+                        }
+                    }
+                    else
+                    {
+                        // value string
+
+                        if (name == "" && shortcut == "")
+                        {
+                            ThrowException(Argument, "Expected \"-\" or \"-\" in command line arguments.\n");
+                        }
+
+                        // Concatenate strings as long as there's no new argument by "-" or "--"
+                        value += arguments[i] + ' ';
+                    }
+                }
+            }
+
+            // parse last argument
+            value = removeTrailingWhitespaces(value);
+            if (name != "")
+            {
+                checkFullArgument(name, value, bParsingFile);
+                assert(shortcut == "");
+            }
+            else if (shortcut != "")
+            {
+                checkShortcut(shortcut, value, bParsingFile);
+                assert(name == "");
+            }
+        }
+        catch (const ArgumentException& ex)
+        {
+            COUT(0) << "Could not parse command line (including additional files): " << ex.what() << std::endl;
+            COUT(0) << CommandLineParser::getUsageInformation() << std::endl;
+            throw GeneralException("");
+        }
+    }
+
+    /**
+    @brief
+        Parses an argument based on its full name.
+    @param name
+        Full name of the argument
+    @param value
+        String containing the value
+    */
+    void CommandLineParser::checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.find(name);
+        if (it == cmdLineArgs_.end())
+            ThrowException(Argument, "Command line argument '" + name + "' does not exist.");
+
+        it->second->parse(value, bParsingFile);
+    }
+
+    /**
+    @brief
+        Parses an argument based on its shortcut.
+    @param shortcut
+        Shotcut to the argument
+    @param value
+        String containing the value
+    */
+    void CommandLineParser::checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgsShortcut_.find(shortcut);
+        if (it == cmdLineArgsShortcut_.end())
+            ThrowException(Argument, "Command line shortcut '" + shortcut + "' does not exist.");
+
+        it->second->parse(value, bParsingFile);
+    }
+
+    std::string CommandLineParser::getUsageInformation()
+    {
+        CommandLineParser& inst = _getInstance();
+        std::ostringstream infoStr;
+
+        // determine maximum name size
+        size_t maxNameSize = 0;
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
+        }
+
+        infoStr << std::endl;
+        infoStr << "Usage: orxonox [options]" << std::endl;
+        infoStr << "Available options:" << std::endl;
+
+        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
+            it != inst.cmdLineArgs_.end(); ++it)
+        {
+            if (it->second->getShortcut() != "")
+                infoStr << " [-" << it->second->getShortcut() << "] ";
+            else
+                infoStr << "      ";
+            infoStr << "--" << it->second->getName() << " ";
+            if (it->second->getValue().getType() != MT_Type::Bool)
+                infoStr << "ARG ";
+            else
+                infoStr << "    ";
+            // fill with the necessary amount of blanks
+            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
+            infoStr << ": " << it->second->getInformation();
+            infoStr << std::endl;
+        }
+        return infoStr.str();
+    }
+
+    /**
+    @brief
+        Retrieves a CommandLineArgument.
+        The method throws an exception if 'name' was not found or the value could not be converted.
+    @note
+        You shold of course not call this method before the command line has been parsed.
+    */
+    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
+    {
+        std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+        if (it == _getInstance().cmdLineArgs_.end())
+        {
+            ThrowException(Argument, "Could find command line argument '" + name + "'.");
+        }
+        else
+        {
+            return it->second;
+        }
+    }
+
+    /**
+    @brief
+        Parses only the command line for CommandLineArguments.
+    */
+    void CommandLineParser::_parseCommandLine(const std::string& cmdLine)
+    {
+        std::vector<std::string> args;
+        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '(', ')', false);
+        for (unsigned i = 0; i < tokens.size(); ++i)
+            args.push_back(tokens[i]);
+        this->_parse(args, false);
+    }
+
+    /**
+    @brief
+        Parses start.ini (or the file specified with --optionsFile) for CommandLineArguments.
+    */
+    void CommandLineParser::_parseFile()
+    {
+        std::string filename = CommandLineParser::getValue("optionsFile").getString();
+
+        // look for additional arguments in given file or start.ini as default
+        // They will not overwrite the arguments given directly
+        std::ifstream file;
+        file.open((PathConfig::getConfigPathString() + filename).c_str());
+        std::vector<std::string> args;
+        if (file)
+        {
+            while (!file.eof())
+            {
+                std::string line;
+                std::getline(file, line);
+                line = removeTrailingWhitespaces(line);
+                //if (!(line[0] == '#' || line[0] == '%'))
+                //{
+                SubString tokens(line, " ", " ", false, '\\', true, '"', true, '(', ')', false, '#');
+                for (unsigned i = 0; i < tokens.size(); ++i)
+                    if (tokens[i][0] != '#')
+                        args.push_back(tokens[i]);
+                //args.insert(args.end(), tokens.getAllStrings().begin(), tokens.getAllStrings().end());
+                //}
+            }
+            file.close();
+        }
+
+        _parse(args, true);
+    }
+}
Index: sandbox/src/libraries/core/CommandLineParser.h
===================================================================
--- sandbox/src/libraries/core/CommandLineParser.h	(revision 6038)
+++ sandbox/src/libraries/core/CommandLineParser.h	(revision 6038)
@@ -0,0 +1,223 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _CommandLine_H__
+#define _CommandLine_H__
+
+#include "CorePrereqs.h"
+
+#include <map>
+#include "util/OrxAssert.h"
+#include "util/MultiType.h"
+
+#define SetCommandLineArgument(name, defaultValue) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, defaultValue, false)
+#define SetCommandLineOnlyArgument(name, defaultValue) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, defaultValue, true)
+#define SetCommandLineSwitch(name) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, false, false)
+#define SetCommandLineOnlySwitch(name) \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    = orxonox::CommandLineParser::addArgument(#name, false, true)
+
+
+namespace orxonox
+{
+    /**
+    @brief
+        Container class for a command line argument of any type supported by MultiType.
+
+        Whenever you want to have an option specified by a command line switch,
+        you need to first define it with SetCommandLineArgument(name, defaultValue).
+        It is then added to a map and possibly changed when the command line is being parsed.
+        If the option was not given, you can detect this by asking hasDefaultValue().
+
+        There is a possibility to define a short cut so you can write "-p 20" instead of "--port 20".
+        Note the difference between "-" and "--"!
+        Also, there is no restriction to the number of strings you add after --name.
+        So "--startVector (2, 4, 5)" is perfectly legal.
+
+        Retrieving an argument is possible with the getCommandLineArgument function of the
+        CommandLineParser class. It is a Singleton, but the public interface is static.
+    */
+    class _CoreExport CommandLineArgument
+    {
+        friend class CommandLineParser;
+
+    public:
+        //! Tells whether the value has been changed by the command line.
+        bool hasDefaultValue() const { return bHasDefaultValue_; }
+        //! Returns the name of the argument.
+        const std::string& getName() const { return name_; }
+
+        //! Returns the shortcut (example: "-p 22" for "--port 22") of the argument.
+        //! Evaluates to "" if there is none.
+        const std::string& getShortcut() const { return shortcut_; }
+        //! Sets the shortcut for the argument
+        CommandLineArgument& shortcut(const std::string& shortcut)
+        { this->shortcut_ = shortcut; return *this; }
+
+        //! Returns the usage information
+        const std::string& getInformation() const { return this->usageInformation_; }
+        //! Sets the option information when displaying orxonox usage.
+        CommandLineArgument& information(const std::string& usage)
+        { this->usageInformation_ = usage; return *this; }
+
+        //! Returns the actual value of the argument. Can be equal to default value.
+        MultiType getValue() const { return value_; }
+        //! Returns the given default value as type T.
+        MultiType getDefaultValue() const { return defaultValue_; }
+
+    private:
+        //! Constructor initialises both value_ and defaultValue_ with defaultValue.
+        CommandLineArgument(const std::string& name, const MultiType& defaultValue, bool bCommandLineOnly)
+            : bHasDefaultValue_(true)
+            , name_(name)
+            , value_(defaultValue)
+            , defaultValue_(defaultValue)
+            , bCommandLineOnly_(bCommandLineOnly)
+        { }
+
+        //! Undefined copy constructor
+        CommandLineArgument(const CommandLineArgument& instance);
+        ~CommandLineArgument() { }
+
+        //! Parses the value string of a command line argument.
+        void parse(const std::string& value, bool bParsingFile);
+
+        //! Tells whether the value has been changed by the command line.
+        bool bHasDefaultValue_;
+
+    private:
+        std::string name_;             //!< Name of the argument
+        std::string shortcut_;         //!< Shortcut of the argument. @see getShortcut().
+        std::string usageInformation_; //!< Tells about the usage of this parameter
+
+        MultiType   value_;            //!< The actual value
+        MultiType   defaultValue_;     //!< Default value. Should not be changed.
+        bool        bCommandLineOnly_; //!< Whether you cannot specify the value in a text file
+    };
+
+
+    /**
+    @brief
+        Global interface to command line options.
+        Allows to add and retrieve command line arguments. Also does the parsing.
+    @note
+        Internally it is a Singleton, but the public interface is static.
+    @see
+        CommandLineArgument
+    */
+    class _CoreExport CommandLineParser
+    {
+    public:
+
+        //! Parse redirection to internal member method.
+        static void parseCommandLine(const std::string& cmdLine) { _getInstance()._parseCommandLine(cmdLine); }
+        static void parseFile() { _getInstance()._parseFile(); }
+
+        static std::string getUsageInformation();
+
+        static const CommandLineArgument* getArgument(const std::string& name);
+        //! Writes the argument value in the given parameter.
+        template <class T>
+        static void getValue(const std::string& name, T* value)
+        { *value = (T)(getArgument(name)->getValue()); }
+        static MultiType getValue(const std::string& name)
+        { return getArgument(name)->getValue(); }
+        template <class T>
+        static CommandLineArgument& addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly);
+
+        static bool existsArgument(const std::string& name)
+        {
+            std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
+            return !(it == _getInstance().cmdLineArgs_.end());
+        }
+
+        static void destroyAllArguments();
+
+    private:
+        //! Constructor initialises bFirstTimeParse_ with true.
+        CommandLineParser() : bFirstTimeParse_(true) { }
+        //! Undefined copy constructor
+        CommandLineParser(const CommandLineParser& instance);
+        ~CommandLineParser();
+
+        static CommandLineParser& _getInstance();
+
+        void _parseCommandLine(const std::string& cmdLine);
+        void _parseFile();
+        void _parse(const std::vector<std::string>& arguments, bool bParsingFile);
+        void checkFullArgument(const std::string& name, const std::string& value, bool bParsingFile);
+        void checkShortcut(const std::string& shortcut, const std::string& value, bool bParsingFile);
+
+        /**
+            Tells whether we parsed for the first time. The CommmandLineArguments are added before main().
+            So when we call parse() the first time, we need to create a map with all shortcuts since these
+            get added after addCommandLineArgument().
+        */
+        bool bFirstTimeParse_;
+
+        //! Holds all pointers to the arguments and serves as a search map by name.
+        std::map<std::string, CommandLineArgument*> cmdLineArgs_;
+        //! Search map by shortcut for the arguments.
+        std::map<std::string, CommandLineArgument*> cmdLineArgsShortcut_;
+    };
+
+    template <>
+    inline void CommandLineParser::getValue<std::string>(const std::string& name, std::string* value)
+    {
+        *value = getArgument(name)->getValue().getString();
+    }
+
+    /**
+    @brief
+        Adds a new CommandLineArgument to the internal map.
+        Note that only such arguments are actually valid.
+    @param name
+        Name of the argument. Shortcut can be added later.
+    @param defaultValue
+        Default value that is used when argument was not given.
+    */
+    template <class T>
+    CommandLineArgument& CommandLineParser::addArgument(const std::string& name, T defaultValue, bool bCommandLineOnly)
+    {
+        OrxAssert(!_getInstance().existsArgument(name),
+            "Cannot add a command line argument with name '" + name + "' twice.");
+        OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
+               "Boolean command line arguments with positive default values are not supported." << std::endl
+            << "Please use SetCommandLineSwitch and adjust your argument: " << name);
+
+        return *(_getInstance().cmdLineArgs_[name] = new CommandLineArgument(name, defaultValue, bCommandLineOnly));
+    }
+}
+
+#endif /* _CommandLine_H__ */
Index: sandbox/src/libraries/core/ConfigFileManager.cc
===================================================================
--- sandbox/src/libraries/core/ConfigFileManager.cc	(revision 5782)
+++ sandbox/src/libraries/core/ConfigFileManager.cc	(revision 6038)
@@ -35,5 +35,5 @@
 #include "util/StringUtils.h"
 #include "ConfigValueContainer.h"
-#include "Core.h"
+#include "PathConfig.h"
 
 namespace orxonox
@@ -41,6 +41,6 @@
     bool config(const std::string& classname, const std::string& varname, const std::string& value)
     {
-        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
-        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
+        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseStringIdentifierMap().find(getLowercase(classname));
+        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
         {
             std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
@@ -53,6 +53,6 @@
     bool tconfig(const std::string& classname, const std::string& varname, const std::string& value)
     {
-        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
-        if (identifier != Identifier::getLowercaseIdentifierMapEnd())
+        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseStringIdentifierMap().find(getLowercase(classname));
+        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
         {
             std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
@@ -215,9 +215,9 @@
 
         // Get default file if necessary and available
-        boost::filesystem::path filepath(Core::getConfigPath() / this->filename_);
+        boost::filesystem::path filepath(PathConfig::getConfigPath() / this->filename_);
         if (!boost::filesystem::exists(filepath))
         {
             // Try to get default one from the data folder
-            boost::filesystem::path defaultFilepath(Core::getDataPath() / "defaultConfig" / this->filename_);
+            boost::filesystem::path defaultFilepath(PathConfig::getDataPath() / "defaultConfig" / this->filename_);
             if (boost::filesystem::exists(defaultFilepath))
             {
@@ -329,5 +329,5 @@
     {
         std::ofstream file;
-        file.open((Core::getConfigPathString() + filename_).c_str(), std::fstream::out);
+        file.open((PathConfig::getConfigPathString() + filename_).c_str(), std::fstream::out);
         file.setf(std::ios::fixed, std::ios::floatfield);
         file.precision(6);
@@ -369,6 +369,6 @@
         for (std::list<ConfigFileSection*>::iterator it1 = this->sections_.begin(); it1 != this->sections_.end(); )
         {
-            std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getIdentifierMap().find((*it1)->getName());
-            if (it2 != Identifier::getIdentifierMapEnd() && (*it2).second->hasConfigValues())
+            std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getStringIdentifierMap().find((*it1)->getName());
+            if (it2 != Identifier::getStringIdentifierMapEnd() && (*it2).second->hasConfigValues())
             {
                 // The section exists, delete comment
@@ -448,5 +448,5 @@
         if (this->type_ == ConfigFileType::Settings)
         {
-            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
+            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapBegin(); it != Identifier::getStringIdentifierMapEnd(); ++it)
             {
                 if (it->second->hasConfigValues())
Index: sandbox/src/libraries/core/Core.cc
===================================================================
--- sandbox/src/libraries/core/Core.cc	(revision 5782)
+++ sandbox/src/libraries/core/Core.cc	(revision 6038)
@@ -37,9 +37,5 @@
 
 #include <cassert>
-#include <fstream>
-#include <cstdlib>
-#include <cstdio>
-#include <boost/version.hpp>
-#include <boost/filesystem.hpp>
+#include <vector>
 
 #ifdef ORXONOX_PLATFORM_WINDOWS
@@ -50,33 +46,19 @@
 #  undef min
 #  undef max
-#elif defined(ORXONOX_PLATFORM_APPLE)
-#  include <sys/param.h>
-#  include <mach-o/dyld.h>
-#else /* Linux */
-#  include <sys/types.h>
-#  include <unistd.h>
-#endif
-
-#include "SpecialConfig.h"
+#endif
+
+#include "util/Clock.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
 #include "util/SignalHandler.h"
-#include "Clock.h"
-#include "CommandLine.h"
+#include "PathConfig.h"
+#include "CommandLineParser.h"
 #include "ConfigFileManager.h"
 #include "ConfigValueIncludes.h"
 #include "CoreIncludes.h"
 #include "DynLibManager.h"
-#include "Factory.h"
 #include "Identifier.h"
 #include "Language.h"
 #include "LuaState.h"
-
-// Boost 1.36 has some issues with deprecated functions that have been omitted
-#if (BOOST_VERSION == 103600)
-#  define BOOST_LEAF_FUNCTION filename
-#else
-#  define BOOST_LEAF_FUNCTION leaf
-#endif
 
 namespace orxonox
@@ -85,6 +67,4 @@
     Core* Core::singletonPtr_s  = 0;
 
-    SetCommandLineArgument(externalDataPath, "").information("Path to the external data files");
-    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
     SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
 #ifdef ORXONOX_PLATFORM_WINDOWS
@@ -195,12 +175,4 @@
         std::string language_;                          //!< The language
         bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
-
-        //! Path to the parent directory of the ones above if program was installed with relativ pahts
-        boost::filesystem::path rootPath_;
-        boost::filesystem::path executablePath_;        //!< Path to the executable
-        boost::filesystem::path modulePath_;            //!< Path to the modules
-        boost::filesystem::path dataPath_;              //!< Path to the data file folder
-        boost::filesystem::path configPath_;            //!< Path to the config file folder
-        boost::filesystem::path logPath_;               //!< Path to the log file folder
     };
 
@@ -210,8 +182,7 @@
         : identifierDestroyer_(Identifier::destroyAllIdentifiers)
         , configuration_(new CoreConfiguration()) // Don't yet create config values!
-        , bDevRun_(false)
     {
         // Set the hard coded fixed paths
-        this->setFixedPaths();
+        this->pathConfig_.reset(new PathConfig());
 
         // Create a new dynamic library manager
@@ -219,69 +190,33 @@
 
         // Load modules
-        try
-        {
-            // We search for helper files with the following extension
-            std::string moduleextension = specialConfig::moduleExtension;
-            size_t moduleextensionlength = moduleextension.size();
-
-            // Search in the directory of our executable
-            boost::filesystem::path searchpath = this->configuration_->modulePath_;
-
-            // Add that path to the PATH variable in case a module depends on another one
-            std::string pathVariable = getenv("PATH");
-            putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_->modulePath_.string()).c_str()));
-
-            boost::filesystem::directory_iterator file(searchpath);
-            boost::filesystem::directory_iterator end;
-
-            // Iterate through all files
-            while (file != end)
+        const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();
+        for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)
+        {
+            try
             {
-                std::string filename = file->BOOST_LEAF_FUNCTION();
-
-                // Check if the file ends with the exension in question
-                if (filename.size() > moduleextensionlength)
-                {
-                    if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
-                    {
-                        // We've found a helper file - now load the library with the same name
-                        std::string library = filename.substr(0, filename.size() - moduleextensionlength);
-                        boost::filesystem::path librarypath = searchpath / library;
-
-                        try
-                        {
-                            DynLibManager::getInstance().load(librarypath.string());
-                        }
-                        catch (...)
-                        {
-                            COUT(1) << "Couldn't load module \"" << librarypath.string() << "\": " << Exception::handleMessage() << std::endl;
-                        }
-                    }
-                }
-
-                ++file;
+                this->dynLibManager_->load(*it);
             }
-        }
-        catch (...)
-        {
-            COUT(1) << "An error occurred while loading modules: " << Exception::handleMessage() << std::endl;
+            catch (...)
+            {
+                COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;
+            }
         }
 
         // Parse command line arguments AFTER the modules have been loaded (static code!)
-        CommandLine::parseCommandLine(cmdLine);
+        CommandLineParser::parseCommandLine(cmdLine);
 
         // Set configurable paths like log, config and media
-        this->setConfigurablePaths();
+        this->pathConfig_->setConfigurablePaths();
 
         // create a signal handler (only active for linux)
         // This call is placed as soon as possible, but after the directories are set
         this->signalHandler_.reset(new SignalHandler());
-        this->signalHandler_->doCatch(configuration_->executablePath_.string(), Core::getLogPathString() + "orxonox_crash.log");
+        this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log");
 
         // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% was used
-        OutputHandler::getOutStream().setLogPath(Core::getLogPathString());
+        OutputHandler::getOutStream().setLogPath(PathConfig::getLogPathString());
 
         // Parse additional options file now that we know its path
-        CommandLine::parseFile();
+        CommandLineParser::parseFile();
 
 #ifdef ORXONOX_PLATFORM_WINDOWS
@@ -289,5 +224,5 @@
         // do this after ogre has initialised. Somehow Ogre changes the settings again (not through
         // the timer though).
-        int limitToCPU = CommandLine::getValue("limitToCPU");
+        int limitToCPU = CommandLineParser::getValue("limitToCPU");
         if (limitToCPU > 0)
             setThreadAffinity(static_cast<unsigned int>(limitToCPU));
@@ -297,5 +232,5 @@
         this->configFileManager_.reset(new ConfigFileManager());
         this->configFileManager_->setFilename(ConfigFileType::Settings,
-            CommandLine::getValue("settingsFile").getString());
+            CommandLineParser::getValue("settingsFile").getString());
 
         // Required as well for the config values
@@ -303,5 +238,5 @@
 
         // creates the class hierarchy for all classes with factories
-        Factory::createClassHierarchy();
+        Identifier::createClassHierarchy();
 
         // Do this soon after the ConfigFileManager has been created to open up the
@@ -376,40 +311,4 @@
     }
 
-    /*static*/ const boost::filesystem::path& Core::getDataPath()
-    {
-        return getInstance().configuration_->dataPath_;
-    }
-    /*static*/ std::string Core::getDataPathString()
-    {
-        return getInstance().configuration_->dataPath_.string() + '/';
-    }
-
-    /*static*/ const boost::filesystem::path& Core::getConfigPath()
-    {
-        return getInstance().configuration_->configPath_;
-    }
-    /*static*/ std::string Core::getConfigPathString()
-    {
-        return getInstance().configuration_->configPath_.string() + '/';
-    }
-
-    /*static*/ const boost::filesystem::path& Core::getLogPath()
-    {
-        return getInstance().configuration_->logPath_;
-    }
-    /*static*/ std::string Core::getLogPathString()
-    {
-        return getInstance().configuration_->logPath_.string() + '/';
-    }
-
-    /*static*/ const boost::filesystem::path& Core::getRootPath()
-    {
-        return getInstance().configuration_->rootPath_;
-    }
-    /*static*/ std::string Core::getRootPathString()
-    {
-        return getInstance().configuration_->rootPath_.string() + '/';
-    }
-
     /**
     @note
@@ -458,173 +357,4 @@
     }
 
-    /**
-    @brief
-        Retrievs the executable path and sets all hard coded fixed path (currently only the module path)
-        Also checks for "orxonox_dev_build.keep_me" in the executable diretory.
-        If found it means that this is not an installed run, hence we
-        don't write the logs and config files to ~/.orxonox
-    @throw
-        GeneralException
-    */
-    void Core::setFixedPaths()
-    {
-        //////////////////////////
-        // FIND EXECUTABLE PATH //
-        //////////////////////////
-
-#ifdef ORXONOX_PLATFORM_WINDOWS
-        // get executable module
-        TCHAR buffer[1024];
-        if (GetModuleFileName(NULL, buffer, 1024) == 0)
-            ThrowException(General, "Could not retrieve executable path.");
-
-#elif defined(ORXONOX_PLATFORM_APPLE)
-        char buffer[1024];
-        unsigned long path_len = 1023;
-        if (_NSGetExecutablePath(buffer, &path_len))
-            ThrowException(General, "Could not retrieve executable path.");
-
-#else /* Linux */
-        /* written by Nicolai Haehnle <prefect_@gmx.net> */
-
-        /* Get our PID and build the name of the link in /proc */
-        char linkname[64]; /* /proc/<pid>/exe */
-        if (snprintf(linkname, sizeof(linkname), "/proc/%i/exe", getpid()) < 0)
-        {
-            /* This should only happen on large word systems. I'm not sure
-               what the proper response is here.
-               Since it really is an assert-like condition, aborting the
-               program seems to be in order. */
-            assert(false);
-        }
-
-        /* Now read the symbolic link */
-        char buffer[1024];
-        int ret;
-        ret = readlink(linkname, buffer, 1024);
-        /* In case of an error, leave the handling up to the caller */
-        if (ret == -1)
-            ThrowException(General, "Could not retrieve executable path.");
-
-        /* Ensure proper NUL termination */
-        buffer[ret] = 0;
-#endif
-
-        configuration_->executablePath_ = boost::filesystem::path(buffer);
-#ifndef ORXONOX_PLATFORM_APPLE
-        configuration_->executablePath_ = configuration_->executablePath_.branch_path(); // remove executable name
-#endif
-
-        /////////////////////
-        // SET MODULE PATH //
-        /////////////////////
-
-        if (boost::filesystem::exists(configuration_->executablePath_ / "orxonox_dev_build.keep_me"))
-        {
-            COUT(1) << "Running from the build tree." << std::endl;
-            Core::bDevRun_ = true;
-            configuration_->modulePath_ = specialConfig::moduleDevDirectory;
-        }
-        else
-        {
-
-#ifdef INSTALL_COPYABLE // --> relative paths
-
-            // Also set the root path
-            boost::filesystem::path relativeExecutablePath(specialConfig::defaultRuntimePath);
-            configuration_->rootPath_ = configuration_->executablePath_;
-            while (!boost::filesystem::equivalent(configuration_->rootPath_ / relativeExecutablePath, configuration_->executablePath_)
-                   && !configuration_->rootPath_.empty())
-                configuration_->rootPath_ = configuration_->rootPath_.branch_path();
-            if (configuration_->rootPath_.empty())
-                ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
-
-            // Module path is fixed as well
-            configuration_->modulePath_ = configuration_->rootPath_ / specialConfig::defaultModulePath;
-
-#else
-
-            // There is no root path, so don't set it at all
-            // Module path is fixed as well
-            configuration_->modulePath_ = specialConfig::moduleInstallDirectory;
-
-#endif
-        }
-    }
-
-    /**
-    @brief
-        Sets config, log and media path and creates folders if necessary.
-    @throws
-        GeneralException
-    */
-    void Core::setConfigurablePaths()
-    {
-        if (Core::isDevelopmentRun())
-        {
-            configuration_->dataPath_  = specialConfig::dataDevDirectory;
-            configuration_->configPath_ = specialConfig::configDevDirectory;
-            configuration_->logPath_    = specialConfig::logDevDirectory;
-        }
-        else
-        {
-
-#ifdef INSTALL_COPYABLE // --> relative paths
-
-            // Using paths relative to the install prefix, complete them
-            configuration_->dataPath_   = configuration_->rootPath_ / specialConfig::defaultDataPath;
-            configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath;
-            configuration_->logPath_    = configuration_->rootPath_ / specialConfig::defaultLogPath;
-
-#else
-
-            configuration_->dataPath_  = specialConfig::dataInstallDirectory;
-
-            // Get user directory
-#  ifdef ORXONOX_PLATFORM_UNIX /* Apple? */
-            char* userDataPathPtr(getenv("HOME"));
-#  else
-            char* userDataPathPtr(getenv("APPDATA"));
-#  endif
-            if (userDataPathPtr == NULL)
-                ThrowException(General, "Could not retrieve user data path.");
-            boost::filesystem::path userDataPath(userDataPathPtr);
-            userDataPath /= ".orxonox";
-
-            configuration_->configPath_ = userDataPath / specialConfig::defaultConfigPath;
-            configuration_->logPath_    = userDataPath / specialConfig::defaultLogPath;
-
-#endif
-
-        }
-
-        // Option to put all the config and log files in a separate folder
-        if (!CommandLine::getArgument("writingPathSuffix")->hasDefaultValue())
-        {
-            std::string directory(CommandLine::getValue("writingPathSuffix").getString());
-            configuration_->configPath_ = configuration_->configPath_ / directory;
-            configuration_->logPath_    = configuration_->logPath_    / directory;
-        }
-
-        // Create directories to avoid problems when opening files in non existent folders.
-        std::vector<std::pair<boost::filesystem::path, std::string> > directories;
-        directories.push_back(std::make_pair(boost::filesystem::path(configuration_->configPath_), "config"));
-        directories.push_back(std::make_pair(boost::filesystem::path(configuration_->logPath_), "log"));
-
-        for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
-            it != directories.end(); ++it)
-        {
-            if (boost::filesystem::exists(it->first) && !boost::filesystem::is_directory(it->first))
-            {
-                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
-                                         Please remove " + it->first.string());
-            }
-            if (boost::filesystem::create_directories(it->first)) // function may not return true at all (bug?)
-            {
-                COUT(4) << "Created " << it->second << " directory" << std::endl;
-            }
-        }
-    }
-
     void Core::preUpdate(const Clock& time)
     {
Index: sandbox/src/libraries/core/Core.h
===================================================================
--- sandbox/src/libraries/core/Core.h	(revision 5782)
+++ sandbox/src/libraries/core/Core.h	(revision 6038)
@@ -28,13 +28,4 @@
  */
 
-/**
-@file
-@brief
-    Declaration of the Core class.
-@details
-    The Core class is a singleton, only used to configure some variables
-    in the core through the config-file.
-*/
-
 #ifndef _Core_H__
 #define _Core_H__
@@ -55,7 +46,4 @@
     @brief
         The Core class is a singleton used to configure the program basics.
-    @details
-        The class provides information about the data, config and log path.
-        It determines those by the use of platform specific functions.
     @remark
         You should only create this singleton once because it destroys the identifiers!
@@ -85,23 +73,4 @@
             static void  resetLanguage();
 
-            //! Returns the path to the data files as boost::filesystem::path
-            static const boost::filesystem::path& getDataPath();
-            //! Returns the path to the config files as boost::filesystem::path
-            static const boost::filesystem::path& getConfigPath();
-            //! Returns the path to the log files as boost::filesystem::path
-            static const boost::filesystem::path& getLogPath();
-            //! Returns the path to the root folder as boost::filesystem::path
-            static const boost::filesystem::path& getRootPath();
-            //! Returns the path to the data files as std::string
-            static std::string getDataPathString();
-            //! Returns the path to the config files as std::string
-            static std::string getConfigPathString();
-            //! Returns the path to the log files as std::string
-            static std::string getLogPathString();
-            //! Returns the path to the root folder as std::string
-            static std::string getRootPathString();
-
-            static bool isDevelopmentRun() { return getInstance().bDevRun_; }
-
         private:
             Core(const Core&); //!< Don't use (undefined symbol)
@@ -110,9 +79,8 @@
             void postUpdate(const Clock& time);
 
-            void setFixedPaths();
-            void setConfigurablePaths();
             void setThreadAffinity(int limitToCPU);
 
             // Mind the order for the destruction!
+            scoped_ptr<PathConfig>        pathConfig_;
             scoped_ptr<DynLibManager>     dynLibManager_;
             scoped_ptr<SignalHandler>     signalHandler_;
@@ -122,6 +90,4 @@
             scoped_ptr<CoreConfiguration> configuration_;
 
-            bool                          bDevRun_;             //!< True for runs in the build directory (not installed)
-
             static Core* singletonPtr_s;
     };
Index: sandbox/src/libraries/core/CoreIncludes.h
===================================================================
--- sandbox/src/libraries/core/CoreIncludes.h	(revision 5782)
+++ sandbox/src/libraries/core/CoreIncludes.h	(revision 6038)
@@ -29,5 +29,5 @@
 /**
     @file
-    @brief Definition of macros for Identifier and Factory.
+    @brief Definition of macros for Identifiers
 
     Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
@@ -45,5 +45,4 @@
 #include "util/Debug.h"
 #include "Identifier.h"
-#include "Factory.h"
 #include "ClassFactory.h"
 #include "ObjectList.h"
@@ -76,9 +75,9 @@
 
 /**
-    @brief Creates the entry in the Factory.
+    @brief Creates the Factory.
     @param ClassName The name of the class
 */
 #define CreateFactory(ClassName) \
-    bool bCreated##ClassName##Factory = orxonox::ClassFactory<ClassName>::create(#ClassName)
+    Factory* _##ClassName##Factory = new orxonox::ClassFactory<ClassName>(#ClassName)
 
 /**
@@ -93,19 +92,19 @@
 {
     /**
-        @brief Returns the Identifier with a given name through the factory.
+        @brief Returns the Identifier with a given name.
         @param String The name of the class
     */
     inline Identifier* ClassByString(const std::string& name)
     {
-        return Factory::getIdentifier(name);
+        return Identifier::getIdentifierByString(name);
     }
 
     /**
-        @brief Returns the Identifier with a given network ID through the factory.
-        @param networkID The network ID of the class
+        @brief Returns the Identifier with a given lowercase name.
+        @param String The lowercase name of the class
     */
-    inline Identifier* ClassByID(uint32_t id)
+    inline Identifier* ClassByLowercaseString(const std::string& name)
     {
-        return Factory::getIdentifier(id);
+        return Identifier::getIdentifierByLowercaseString(name);
     }
 }
Index: sandbox/src/libraries/core/CorePrereqs.h
===================================================================
--- sandbox/src/libraries/core/CorePrereqs.h	(revision 5782)
+++ sandbox/src/libraries/core/CorePrereqs.h	(revision 6038)
@@ -28,6 +28,7 @@
 
 /**
-  @file
-  @brief Contains all the necessary forward declarations for all classes and structs.
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the core library
 */
 
@@ -40,4 +41,5 @@
 // Shared library settings
 //-----------------------------------------------------------------------
+
 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( CORE_STATIC_BUILD )
 #  ifdef CORE_SHARED_BUILD
@@ -56,8 +58,17 @@
 #endif
 
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
+//-----------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);
+}
+
+//-----------------------------------------------------------------------
+// Enums
+//-----------------------------------------------------------------------
+
 namespace orxonox
 {
@@ -66,9 +77,10 @@
         enum Mode
         {
+            NOP,
             LoadObject,
             SaveObject,
             ExpandObject
         };
-    }
+}
 
     namespace KeybindMode
@@ -82,11 +94,16 @@
         };
     };
-
+}
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
     typedef std::string LanguageEntryLabel;
 
     class ArgumentCompleter;
     class ArgumentCompletionListElement;
-    class BaseFactory;
-    class BaseMetaObjectListElement;
     class BaseObject;
     template <class T>
@@ -98,8 +115,6 @@
     class ClassTreeMaskNode;
     class ClassTreeMaskObjectIterator;
-    class Clock;
     class CommandEvaluation;
-    class CommandExecutor;
-    class CommandLine;
+    class CommandLineParser;
     class CommandLineArgument;
     class ConfigFile;
@@ -109,4 +124,5 @@
     class ConfigFileManager;
     class ConfigFileSection;
+    struct ConfigFileType;
     class ConfigValueContainer;
     class ConsoleCommand;
@@ -115,5 +131,5 @@
     class DynLibManager;
     struct Event;
-    class EventContainer;
+    class EventState;
     class Executor;
     template <class T>
@@ -125,4 +141,8 @@
     class FunctorMember;
     class FunctorStatic;
+    class Game;
+    class GameState;
+    struct GameStateInfo;
+    struct GameStateTreeNode;
     class GraphicsManager;
     class GUIManager;
@@ -131,8 +151,5 @@
     template <class T>
     class Iterator;
-    class IteratorBase;
     class Language;
-    class LanguageEntry;
-    class Loader;
     class LuaState;
     class MemoryArchive;
@@ -152,8 +169,11 @@
     class OgreWindowEventListener;
     class OrxonoxClass;
+    class PathConfig;
     struct ResourceInfo;
     class Shell;
     class ShellListener;
     template <class T>
+    class SmartPtr;
+    template <class T>
     class SubclassIdentifier;
     class TclBind;
@@ -163,4 +183,8 @@
     class TclThreadManager;
     class Template;
+    class Thread;
+    class ThreadPool;
+    template <class T>
+    class WeakPtr;
     class WindowEventListener;
     class XMLFile;
@@ -173,15 +197,8 @@
     class XMLPortParamContainer;
 
-    // game states
-    class Game;
-    class GameState;
-    struct GameStateInfo;
-    struct GameStateTreeNode;
-
-    // input
+    // Input
     class BaseCommand;
     class BufferedParamCommand;
     class Button;
-    class CalibratorCallback;
     class HalfAxis;
     class InputBuffer;
@@ -192,16 +209,15 @@
     class InputManager;
     class InputState;
+    struct InputStatePriority;
+    class JoyStickQuantityListener;
     class JoyStick;
+    class KeyBinder;
+    class KeyBinderManager;
+    class Keyboard;
+    class KeyDetector;
+    class KeyEvent;
     class Mouse;
-    class Keyboard;
-    class KeyBinder;
-    class KeyDetector;
     class ParamCommand;
     class SimpleCommand;
-
-
-    // multithreading
-    class Thread;
-    class ThreadPool;
 }
 
@@ -282,13 +298,6 @@
 namespace orxonox
 {
-    using ticpp::Document;
     using ticpp::Element;
-    using ticpp::Declaration;
-    using ticpp::StylesheetReference;
-    using ticpp::Text;
-    using ticpp::Comment;
-    using ticpp::Attribute;
-}
-
+}
 
 #endif /* _CorePrereqs_H__ */
Index: sandbox/src/libraries/core/Factory.cc
===================================================================
--- sandbox/src/libraries/core/Factory.cc	(revision 5782)
+++ 	(revision )
@@ -1,94 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of the Factory class.
-*/
-
-#include "Factory.h"
-
-#include "util/Debug.h"
-#include "Identifier.h"
-#include "BaseObject.h"
-
-namespace orxonox
-{
-    /**
-        @brief Returns the Identifier with a given name.
-        @param name The name of the wanted Identifier
-        @return The Identifier
-    */
-    Identifier* Factory::getIdentifier(const std::string& name)
-    {
-        std::map<std::string, Identifier*>::const_iterator it = getFactoryPointer()->identifierStringMap_.find(name);
-        if (it != getFactoryPointer()->identifierStringMap_.end())
-            return it->second;
-        else
-            return 0;
-    }
-
-    /**
-        @brief Adds a new Identifier to both maps.
-        @param name The name of the identifier
-        @param identifier The identifier to add
-    */
-    void Factory::add(const std::string& name, Identifier* identifier)
-    {
-        getFactoryPointer()->identifierStringMap_[name] = identifier;
-    }
-
-    /**
-        @brief Creates the class-hierarchy by creating and destroying one object of each type.
-    */
-    void Factory::createClassHierarchy()
-    {
-        COUT(3) << "*** Factory: Create class-hierarchy" << std::endl;
-        std::map<std::string, Identifier*>::iterator it;
-        it = getFactoryPointer()->identifierStringMap_.begin();
-        (*getFactoryPointer()->identifierStringMap_.begin()).second->startCreatingHierarchy();
-        for (it = getFactoryPointer()->identifierStringMap_.begin(); it != getFactoryPointer()->identifierStringMap_.end(); ++it)
-        {
-            // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
-            BaseObject* temp = (*it).second->fabricate(0);
-            delete temp;
-        }
-        (*getFactoryPointer()->identifierStringMap_.begin()).second->stopCreatingHierarchy();
-        COUT(3) << "*** Factory: Finished class-hierarchy creation" << std::endl;
-    }
-
-    /**
-        @brief Ensures the Factory gets created in the right moment.
-        @return The Factory.
-    */
-    Factory* Factory::getFactoryPointer()
-    {
-      static Factory theOneAndOnlyFactoryInstance = Factory();
-      return &theOneAndOnlyFactoryInstance;
-    }
-}
Index: sandbox/src/libraries/core/Factory.h
===================================================================
--- sandbox/src/libraries/core/Factory.h	(revision 5782)
+++ 	(revision )
@@ -1,98 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Definition of the Factory and the BaseFactory class.
-
-    The Factory is a singleton, containing two maps to map either the name or the network ID
-    of a class with the corresponding Identifier.
-
-    Usage:
-    ID(classname) or ID(networkID) returns the corresponding Identifier.
-
-
-    BaseObject is the parent of ClassFactory which is defined in ClassFactory.h.
-    It can't be defined in ClassFactory.h, because of circular dependencies.
-*/
-
-#ifndef _Factory_H__
-#define _Factory_H__
-
-#include "CorePrereqs.h"
-
-#include <map>
-#include <string>
-
-namespace orxonox
-{
-    // ###############################
-    // ###         Factory         ###
-    // ###############################
-    //! The Factory is used to map the name or the network ID of a class with its Identifier.
-    class _CoreExport Factory
-    {
-        public:
-            static Identifier* getIdentifier(const std::string& name);
-            static Identifier* getIdentifier(const uint32_t id);
-            static void add(const std::string& name, Identifier* identifier);
-            static void createClassHierarchy();
-
-            static Factory* getFactoryPointer();    // avoid overriding order problem in the static intialisation process
-
-            /** @brief Returns the factory-map. */
-            static const std::map<std::string, Identifier*>& getFacbtoryMap()
-                { return Factory::getFactoryPointer()->identifierStringMap_; }
-            /** @brief Returns the begin-iterator of the factory-map. */
-            static std::map<std::string, Identifier*>::const_iterator getFactoryMapBegin()
-                { return Factory::getFactoryPointer()->identifierStringMap_.begin(); }
-            /** @brief Returns the end-iterator of the factory-map. */
-            static std::map<std::string, Identifier*>::const_iterator getFactoryMapEnd()
-                { return Factory::getFactoryPointer()->identifierStringMap_.end(); }
-
-        private:
-            Factory() {}                            // don't create
-            Factory(const Factory& factory);        // don't copy
-            ~Factory() {}                           // don't delete
-
-            std::map<std::string, Identifier*> identifierStringMap_;            //!< The map, mapping the name with the Identifier
-    };
-
-    // ###############################
-    // ###       BaseFactory       ###
-    // ###############################
-    //! Base-class of ClassFactory. Has to be defined separate because of circular dependencies.
-    class _CoreExport BaseFactory
-    {
-        public:
-            virtual BaseObject* fabricate(BaseObject* creator) = 0;
-            virtual ~BaseFactory() {};
-    };
-}
-
-#endif /* _Factory_H__ */
Index: sandbox/src/libraries/core/Functor.h
===================================================================
--- sandbox/src/libraries/core/Functor.h	(revision 5782)
+++ sandbox/src/libraries/core/Functor.h	(revision 6038)
@@ -191,29 +191,35 @@
 
 
-#define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams
-#define FUNCTOR_TEMPLATE000
-#define FUNCTOR_TEMPLATE001 template <class P1>
-#define FUNCTOR_TEMPLATE002 template <class P1, class P2>
-#define FUNCTOR_TEMPLATE003 template <class P1, class P2, class P3>
-#define FUNCTOR_TEMPLATE004 template <class P1, class P2, class P3, class P4>
-#define FUNCTOR_TEMPLATE005 template <class P1, class P2, class P3, class P4, class P5>
-#define FUNCTOR_TEMPLATE010 template <class R>
-#define FUNCTOR_TEMPLATE011 template <class R, class P1>
-#define FUNCTOR_TEMPLATE012 template <class R, class P1, class P2>
-#define FUNCTOR_TEMPLATE013 template <class R, class P1, class P2, class P3>
-#define FUNCTOR_TEMPLATE014 template <class R, class P1, class P2, class P3, class P4>
-#define FUNCTOR_TEMPLATE015 template <class R, class P1, class P2, class P3, class P4, class P5>
-#define FUNCTOR_TEMPLATE100 template <class T>
-#define FUNCTOR_TEMPLATE101 template <class T, class P1>
-#define FUNCTOR_TEMPLATE102 template <class T, class P1, class P2>
-#define FUNCTOR_TEMPLATE103 template <class T, class P1, class P2, class P3>
-#define FUNCTOR_TEMPLATE104 template <class T, class P1, class P2, class P3, class P4>
-#define FUNCTOR_TEMPLATE105 template <class T, class P1, class P2, class P3, class P4, class P5>
-#define FUNCTOR_TEMPLATE110 template <class T, class R>
-#define FUNCTOR_TEMPLATE111 template <class T, class R, class P1>
-#define FUNCTOR_TEMPLATE112 template <class T, class R, class P1, class P2>
-#define FUNCTOR_TEMPLATE113 template <class T, class R, class P1, class P2, class P3>
-#define FUNCTOR_TEMPLATE114 template <class T, class R, class P1, class P2, class P3, class P4>
-#define FUNCTOR_TEMPLATE115 template <class T, class R, class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams, additionalobject) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams(additionalobject)
+#define FUNCTOR_TEMPLATE000(additionalobject)
+#define FUNCTOR_TEMPLATE001(additionalobject) template <class P1>
+#define FUNCTOR_TEMPLATE002(additionalobject) template <class P1, class P2>
+#define FUNCTOR_TEMPLATE003(additionalobject) template <class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE004(additionalobject) template <class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE005(additionalobject) template <class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE010(additionalobject) template <class R>
+#define FUNCTOR_TEMPLATE011(additionalobject) template <class R, class P1>
+#define FUNCTOR_TEMPLATE012(additionalobject) template <class R, class P1, class P2>
+#define FUNCTOR_TEMPLATE013(additionalobject) template <class R, class P1, class P2, class P3>
+#define FUNCTOR_TEMPLATE014(additionalobject) template <class R, class P1, class P2, class P3, class P4>
+#define FUNCTOR_TEMPLATE015(additionalobject) template <class R, class P1, class P2, class P3, class P4, class P5>
+#define FUNCTOR_TEMPLATE100(additionalobject) template <class T FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE101(additionalobject) template <class T, class P1 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE102(additionalobject) template <class T, class P1, class P2 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE103(additionalobject) template <class T, class P1, class P2, class P3 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE104(additionalobject) template <class T, class P1, class P2, class P3, class P4 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE105(additionalobject) template <class T, class P1, class P2, class P3, class P4, class P5 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE110(additionalobject) template <class T, class R FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE111(additionalobject) template <class T, class R, class P1 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE112(additionalobject) template <class T, class R, class P1, class P2 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE113(additionalobject) template <class T, class R, class P1, class P2, class P3 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE114(additionalobject) template <class T, class R, class P1, class P2, class P3, class P4 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+#define FUNCTOR_TEMPLATE115(additionalobject) template <class T, class R, class P1, class P2, class P3, class P4, class P5 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) >
+
+
+
+#define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT##additionalobject
+#define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT0
+#define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT1 , class O
 
 
@@ -317,5 +323,5 @@
 
 #define CREATE_STATIC_FUNCTOR(returnvalue, numparams) \
-    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(0, returnvalue, numparams, 0) \
     class FunctorStatic##returnvalue##numparams : public FunctorStatic \
     { \
@@ -347,5 +353,5 @@
     \
     \
-    FUNCTOR_TEMPLATE(0, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(0, returnvalue, numparams, 0) \
     inline FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
     { \
@@ -358,5 +364,5 @@
 
 #define CREATE_MEMBER_FUNCTOR(returnvalue, numparams) \
-    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \
     class FunctorMember##returnvalue##numparams : public FunctorMember<T> \
     { \
@@ -391,5 +397,5 @@
     \
     \
-    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \
     class FunctorConstMember##returnvalue##numparams : public FunctorMember<T> \
     { \
@@ -423,5 +429,5 @@
     \
     \
-    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \
     inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
     { \
@@ -430,8 +436,25 @@
     \
     \
-    FUNCTOR_TEMPLATE(1, returnvalue, numparams) \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \
     inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \
     { \
         return new FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
+    } \
+    \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 1) \
+    inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)), O* object) \
+    { \
+        FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* functor = new FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
+        functor->setObject(object); \
+        return functor; \
+    } \
+    \
+    \
+    FUNCTOR_TEMPLATE(1, returnvalue, numparams, 1) \
+    inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const, O* object) \
+    { \
+        FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* functor = new FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
+        functor->setObject(object); \
+        return functor; \
     }
 
Index: sandbox/src/libraries/core/Game.cc
===================================================================
--- sandbox/src/libraries/core/Game.cc	(revision 5782)
+++ sandbox/src/libraries/core/Game.cc	(revision 6038)
@@ -38,4 +38,5 @@
 #include <boost/weak_ptr.hpp>
 
+#include "util/Clock.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
@@ -43,6 +44,5 @@
 #include "util/Sleep.h"
 #include "util/SubString.h"
-#include "Clock.h"
-#include "CommandLine.h"
+#include "CommandLineParser.h"
 #include "Core.h"
 #include "CoreIncludes.h"
@@ -105,5 +105,5 @@
     Game::Game(const std::string& cmdLine)
         // Destroy factories before the Core!
-        : gsFactoryDestroyer_(Game::GameStateFactory::factories_s, &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
+        : gsFactoryDestroyer_(Game::GameStateFactory::getFactories(), &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
     {
         this->bAbort_ = false;
@@ -404,4 +404,6 @@
                 requestedNodes.push_back(currentNode);
             }
+            if (currentNode == NULL)
+                requestedNodes.clear();
         }
 
@@ -451,10 +453,10 @@
     {
         // Split string into pieces of the form whitespacesText
-        std::vector<std::pair<std::string, unsigned> > stateStrings;
+        std::vector<std::pair<std::string, int> > stateStrings;
         size_t pos = 0;
         size_t startPos = 0;
         while (pos < str.size())
         {
-            unsigned indentation = 0;
+            int indentation = 0;
             while(pos < str.size() && str[pos] == ' ')
                 ++indentation, ++pos;
@@ -464,37 +466,46 @@
             stateStrings.push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation));
         }
-        unsigned int currentLevel = 0;
-        shared_ptr<GameStateTreeNode> currentNode = this->rootStateNode_;
-        for (std::vector<std::pair<std::string, unsigned> >::const_iterator it = stateStrings.begin(); it != stateStrings.end(); ++it)
-        {
-            std::string newStateName = it->first;
-            unsigned newLevel = it->second + 1; // empty root is 0
-            if (!this->checkState(newStateName))
-                ThrowException(GameState, "GameState with name '" << newStateName << "' not found!");
-            if (newStateName == this->rootStateNode_->name_)
+        if (stateStrings.empty())
+            ThrowException(GameState, "Emtpy GameState hierarchy provided, terminating.");
+        // Add element with large identation to detect the last with just an iterator
+        stateStrings.push_back(std::make_pair("", -1));
+
+        // Parse elements recursively
+        std::vector<std::pair<std::string, int> >::const_iterator begin = stateStrings.begin();
+        parseStates(begin, this->rootStateNode_);
+    }
+
+    /*** Internal ***/
+
+    void Game::parseStates(std::vector<std::pair<std::string, int> >::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode)
+        {
+        SubString tokens(it->first, ",");
+        std::vector<std::pair<std::string, int> >::const_iterator startIt = it;
+
+        for (unsigned int i = 0; i < tokens.size(); ++i)
+        {
+            it = startIt; // Reset iterator to the beginning of the sub tree
+            if (!this->checkState(tokens[i]))
+                ThrowException(GameState, "GameState with name '" << tokens[i] << "' not found!");
+            if (tokens[i] == this->rootStateNode_->name_)
                 ThrowException(GameState, "You shouldn't use 'emptyRootGameState' in the hierarchy...");
-            shared_ptr<GameStateTreeNode> newNode(new GameStateTreeNode);
-            newNode->name_ = newStateName;
-
-            if (newLevel <= currentLevel)
-            {
-                do
-                    currentNode = currentNode->parent_.lock();
-                while (newLevel <= --currentLevel);
-            }
-            if (newLevel == currentLevel + 1)
-            {
-                // Add the child
-                newNode->parent_ = currentNode;
-                currentNode->children_.push_back(newNode);
-            }
+            shared_ptr<GameStateTreeNode> node(new GameStateTreeNode());
+            node->name_ = tokens[i];
+            node->parent_ = currentNode;
+            currentNode->children_.push_back(node);
+
+            int currentLevel = it->second;
+            ++it;
+            while (it->second != -1)
+            {
+                if (it->second <= currentLevel)
+                    break;
+                else if (it->second == currentLevel + 1)
+                    parseStates(it, node);
             else
                 ThrowException(GameState, "Indentation error while parsing the hierarchy.");
-            currentNode = newNode;
-            currentLevel = newLevel;
-        }
-    }
-
-    /*** Internal ***/
+        }
+    }
+    }
 
     void Game::loadGraphics()
@@ -566,10 +577,14 @@
     }
 
-    std::map<std::string, shared_ptr<Game::GameStateFactory> > Game::GameStateFactory::factories_s;
+    /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> >& Game::GameStateFactory::getFactories()
+    {
+        static std::map<std::string, shared_ptr<GameStateFactory> > factories;
+        return factories;
+    }
 
     /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)
     {
-        std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = factories_s.find(info.className);
-        assert(it != factories_s.end());
+        std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = getFactories().find(info.className);
+        assert(it != getFactories().end());
         return it->second->fabricateInternal(info);
     }
Index: sandbox/src/libraries/core/Game.h
===================================================================
--- sandbox/src/libraries/core/Game.h	(revision 5782)
+++ sandbox/src/libraries/core/Game.h	(revision 6038)
@@ -117,8 +117,8 @@
             template <class T>
             static void createFactory(const std::string& className)
-                { factories_s[className].reset(new TemplateGameStateFactory<T>()); }
+                { getFactories()[className].reset(new TemplateGameStateFactory<T>()); }
 
             virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
-            static std::map<std::string, shared_ptr<GameStateFactory> > factories_s;
+            static std::map<std::string, shared_ptr<GameStateFactory> >& getFactories();
         };
         template <class T>
@@ -143,4 +143,5 @@
         void unloadGraphics();
 
+        void parseStates(std::vector<std::pair<std::string, int> >::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode);
         bool checkState(const std::string& name) const;
         void loadState(const std::string& name);
Index: sandbox/src/libraries/core/GameState.h
===================================================================
--- sandbox/src/libraries/core/GameState.h	(revision 5782)
+++ sandbox/src/libraries/core/GameState.h	(revision 6038)
@@ -40,4 +40,5 @@
 #include <map>
 #include <string>
+#include "util/UtilPrereqs.h"
 
 namespace orxonox
Index: sandbox/src/libraries/core/Identifier.cc
===================================================================
--- sandbox/src/libraries/core/Identifier.cc	(revision 5782)
+++ sandbox/src/libraries/core/Identifier.cc	(revision 6038)
@@ -37,6 +37,7 @@
 
 #include "util/StringUtils.h"
+#include "BaseObject.h"
 #include "ConfigValueContainer.h"
-#include "Factory.h"
+#include "ClassFactory.h"
 
 namespace orxonox
@@ -62,6 +63,4 @@
         this->bHasConfigValues_ = false;
 
-        this->children_ = new std::set<const Identifier*>();
-        this->directChildren_ = new std::set<const Identifier*>();
     }
 
@@ -71,6 +70,4 @@
     Identifier::~Identifier()
     {
-        delete this->children_;
-        delete this->directChildren_;
         delete this->objects_;
 
@@ -105,5 +102,5 @@
             // There is already an entry: return it and delete the proposal
             delete proposal;
-            return (*it).second;
+            return it->second;
         }
         else
@@ -152,5 +149,5 @@
             {
                 // Tell the parent we're one of it's children
-                (*it)->getChildrenIntern().insert((*it)->getChildrenIntern().end(), this);
+                (*it)->children_.insert((*it)->children_.end(), this);
 
                 // Erase all parents of our parent from our direct-parent-list
@@ -174,7 +171,27 @@
             {
                 // Tell the parent we're one of it's direct children
-                (*it)->getDirectChildrenIntern().insert((*it)->getDirectChildrenIntern().end(), this);
+                (*it)->directChildren_.insert((*it)->directChildren_.end(), this);
             }
         }
+    }
+
+    /**
+        @brief Creates the class-hierarchy by creating and destroying one object of each type.
+    */
+    void Identifier::createClassHierarchy()
+    {
+        COUT(3) << "*** Identifier: Create class-hierarchy" << std::endl;
+        Identifier::startCreatingHierarchy();
+        for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMap().begin(); it != Identifier::getStringIdentifierMap().end(); ++it)
+        {
+            // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
+            if (it->second->hasFactory())
+            {
+                BaseObject* temp = it->second->fabricate(0);
+                delete temp;
+            }
+        }
+        Identifier::stopCreatingHierarchy();
+        COUT(3) << "*** Identifier: Finished class-hierarchy creation" << std::endl;
     }
 
@@ -198,6 +215,6 @@
             this->name_ = name;
             this->bSetName_ = true;
-            Identifier::getIdentifierMapIntern()[name] = this;
-            Identifier::getLowercaseIdentifierMapIntern()[getLowercase(name)] = this;
+            Identifier::getStringIdentifierMapIntern()[name] = this;
+            Identifier::getLowercaseStringIdentifierMapIntern()[getLowercase(name)] = this;
         }
     }
@@ -219,5 +236,5 @@
             COUT(1) << "Aborting..." << std::endl;
             abort();
-            return NULL;
+            return 0;
         }
     }
@@ -265,5 +282,5 @@
     bool Identifier::isParentOf(const Identifier* identifier) const
     {
-        return (this->children_->find(identifier) != this->children_->end());
+        return (this->children_.find(identifier) != this->children_.end());
     }
 
@@ -274,12 +291,12 @@
     bool Identifier::isDirectParentOf(const Identifier* identifier) const
     {
-        return (this->directChildren_->find(identifier) != this->directChildren_->end());
-    }
-
-    /**
-        @brief Returns the map that stores all Identifiers.
+        return (this->directChildren_.find(identifier) != this->directChildren_.end());
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers with their names.
         @return The map
     */
-    std::map<std::string, Identifier*>& Identifier::getIdentifierMapIntern()
+    std::map<std::string, Identifier*>& Identifier::getStringIdentifierMapIntern()
     {
         static std::map<std::string, Identifier*> identifierMap;
@@ -288,11 +305,49 @@
 
     /**
-        @brief Returns the map that stores all Identifiers.
+        @brief Returns the map that stores all Identifiers with their names in lowercase.
         @return The map
     */
-    std::map<std::string, Identifier*>& Identifier::getLowercaseIdentifierMapIntern()
+    std::map<std::string, Identifier*>& Identifier::getLowercaseStringIdentifierMapIntern()
     {
         static std::map<std::string, Identifier*> lowercaseIdentifierMap;
         return lowercaseIdentifierMap;
+    }
+
+    /**
+        @brief Returns the map that stores all Identifiers with their network IDs.
+        @return The map
+    */
+    std::map<uint32_t, Identifier*>& Identifier::getIDIdentifierMapIntern()
+    {
+        static std::map<uint32_t, Identifier*> identifierMap;
+        return identifierMap;
+    }
+
+    /**
+        @brief Returns the Identifier with a given name.
+        @param name The name of the wanted Identifier
+        @return The Identifier
+    */
+    Identifier* Identifier::getIdentifierByString(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapIntern().find(name);
+        if (it != Identifier::getStringIdentifierMapIntern().end())
+            return it->second;
+        else
+            return 0;
+    }
+
+    /**
+        @brief Returns the Identifier with a given name in lowercase.
+        @param name The name of the wanted Identifier
+        @return The Identifier
+    */
+    Identifier* Identifier::getIdentifierByLowercaseString(const std::string& name)
+    {
+        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseStringIdentifierMapIntern().find(name);
+        if (it != Identifier::getLowercaseStringIdentifierMapIntern().end())
+            return it->second;
+        else
+            return 0;
     }
 
@@ -325,5 +380,5 @@
         std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_.find(varname);
         if (it != configValues_.end())
-            return ((*it).second);
+            return it->second;
         else
             return 0;
@@ -339,5 +394,5 @@
         std::map<std::string, ConfigValueContainer*>::const_iterator it = configValues_LC_.find(varname);
         if (it != configValues_LC_.end())
-            return ((*it).second);
+            return it->second;
         else
             return 0;
@@ -353,5 +408,9 @@
     {
         for (std::set<const Identifier*>::const_iterator it = list.begin(); it != list.end(); ++it)
-            out << (*it)->getName() << " ";
+        {
+            if (it != list.begin())
+                out << " ";
+            out << (*it)->getName();
+        }
 
         return out;
Index: sandbox/src/libraries/core/Identifier.h
===================================================================
--- sandbox/src/libraries/core/Identifier.h	(revision 5782)
+++ sandbox/src/libraries/core/Identifier.h	(revision 6038)
@@ -29,5 +29,5 @@
 /**
     @file
-    @brief Definition of the Identifier, ClassIdentifier and SubclassIdentifier classes, implementation of the ClassIdentifier and SubclassIdentifier classes.
+    @brief Definition of the Identifier class, definition and implementation of the ClassIdentifier class.
 
     The Identifier contains all needed information about the class it belongs to:
@@ -45,7 +45,4 @@
 
     Every Identifier is in fact a ClassIdentifier, but they are derived from Identifier.
-
-    SubclassIdentifier is a separated class, acting like an Identifier, but has a given class.
-    You can only assign Identifiers of exactly the given class or of a derivative to a SubclassIdentifier.
 */
 
@@ -89,14 +86,22 @@
     class _CoreExport Identifier
     {
-        template <class T>
-        friend class SubclassIdentifier;
-
-        friend class Factory;
-
         public:
+            /** @brief Returns the name of the class the Identifier belongs to. @return The name */
+            inline const std::string& getName() const { return this->name_; }
+            void setName(const std::string& name);
+
+            /** @brief Returns the unique ID of the class */
+            FORCEINLINE unsigned int getClassID() const { return this->classID_; }
+
+            /** @brief Returns the list of all existing objects of this class. @return The list */
+            inline ObjectListBase* getObjects() const { return this->objects_; }
+
             /** @brief Sets the Factory. @param factory The factory to assign */
-            inline void addFactory(BaseFactory* factory) { this->factory_ = factory; }
+            inline void addFactory(Factory* factory) { this->factory_ = factory; }
+            /** @brief Returns true if the Identifier has a Factory. */
+            inline bool hasFactory() const { return (this->factory_ != 0); }
 
             BaseObject* fabricate(BaseObject* creator);
+
             bool isA(const Identifier* identifier) const;
             bool isExactlyA(const Identifier* identifier) const;
@@ -106,13 +111,12 @@
             bool isDirectParentOf(const Identifier* identifier) const;
 
-            /** @brief Returns the list of all existing objects of this class. @return The list */
-            inline ObjectListBase* getObjects() const
-                { return this->objects_; }
-
-            /** @brief Returns the name of the class the Identifier belongs to. @return The name */
-            inline const std::string& getName() const { return this->name_; }
-            void setName(const std::string& name);
-
-            virtual void updateConfigValues(bool updateChildren = true) const = 0;
+
+            /////////////////////////////
+            ////// Class Hierarchy //////
+            /////////////////////////////
+            static void createClassHierarchy();
+
+            /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
+            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
 
             /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
@@ -124,9 +128,9 @@
 
             /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
-            inline const std::set<const Identifier*>& getChildren() const { return (*this->children_); }
+            inline const std::set<const Identifier*>& getChildren() const { return this->children_; }
             /** @brief Returns the begin-iterator of the children-list. @return The begin-iterator */
-            inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_->begin(); }
+            inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_.begin(); }
             /** @brief Returns the end-iterator of the children-list. @return The end-iterator */
-            inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_->end(); }
+            inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_.end(); }
 
             /** @brief Returns the direct parents of the class the Identifier belongs to. @return The list of all direct parents */
@@ -138,25 +142,51 @@
 
             /** @brief Returns the direct children the class the Identifier belongs to. @return The list of all direct children */
-            inline const std::set<const Identifier*>& getDirectChildren() const { return (*this->directChildren_); }
+            inline const std::set<const Identifier*>& getDirectChildren() const { return this->directChildren_; }
             /** @brief Returns the begin-iterator of the direct-children-list. @return The begin-iterator */
-            inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_->begin(); }
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_.begin(); }
             /** @brief Returns the end-iterator of the direct-children-list. @return The end-iterator */
-            inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); }
-
-
-            /** @brief Returns the map that stores all Identifiers. @return The map */
-            static inline const std::map<std::string, Identifier*>& getIdentifierMap() { return Identifier::getIdentifierMapIntern(); }
-            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers. @return The const_iterator */
-            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapBegin() { return Identifier::getIdentifierMap().begin(); }
-            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers. @return The const_iterator */
-            static inline std::map<std::string, Identifier*>::const_iterator getIdentifierMapEnd() { return Identifier::getIdentifierMap().end(); }
+            inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_.end(); }
+
+
+            //////////////////////////
+            ///// Identifier Map /////
+            //////////////////////////
+            static void destroyAllIdentifiers();
+
+            static Identifier* getIdentifierByString(const std::string& name);
+            static Identifier* getIdentifierByLowercaseString(const std::string& name);
+            static Identifier* getIdentifierByID(uint32_t id);
+
+            static void clearNetworkIDs();
+
+            /** @brief Returns the map that stores all Identifiers with their names. @return The map */
+            static inline const std::map<std::string, Identifier*>& getStringIdentifierMap() { return Identifier::getStringIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers with their names. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapBegin() { return Identifier::getStringIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers with their names. @return The const_iterator */
+            static inline std::map<std::string, Identifier*>::const_iterator getStringIdentifierMapEnd() { return Identifier::getStringIdentifierMap().end(); }
 
             /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
-            static inline const std::map<std::string, Identifier*>& getLowercaseIdentifierMap() { return Identifier::getLowercaseIdentifierMapIntern(); }
+            static inline const std::map<std::string, Identifier*>& getLowercaseStringIdentifierMap() { return Identifier::getLowercaseStringIdentifierMapIntern(); }
             /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
-            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapBegin() { return Identifier::getLowercaseIdentifierMap().begin(); }
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapBegin() { return Identifier::getLowercaseStringIdentifierMap().begin(); }
             /** @brief Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase. @return The const_iterator */
-            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseIdentifierMapEnd() { return Identifier::getLowercaseIdentifierMap().end(); }
-
+            static inline std::map<std::string, Identifier*>::const_iterator getLowercaseStringIdentifierMapEnd() { return Identifier::getLowercaseStringIdentifierMap().end(); }
+
+            /** @brief Returns the map that stores all Identifiers with their IDs. @return The map */
+            static inline const std::map<uint32_t, Identifier*>& getIDIdentifierMap() { return Identifier::getIDIdentifierMapIntern(); }
+            /** @brief Returns a const_iterator to the beginning of the map that stores all Identifiers with their IDs. @return The const_iterator */
+            static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapBegin() { return Identifier::getIDIdentifierMap().begin(); }
+            /** @brief Returns a const_iterator to the end of the map that stores all Identifiers with their IDs. @return The const_iterator */
+            static inline std::map<uint32_t, Identifier*>::const_iterator getIDIdentifierMapEnd() { return Identifier::getIDIdentifierMap().end(); }
+
+
+            /////////////////////////
+            ///// Config Values /////
+            /////////////////////////
+            virtual void updateConfigValues(bool updateChildren = true) const = 0;
+
+            /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */
+            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
 
             /** @brief Returns the map that stores all config values. @return The const_iterator */
@@ -174,21 +204,8 @@
             inline std::map<std::string, ConfigValueContainer*>::const_iterator getLowercaseConfigValueMapEnd() const { return this->configValues_LC_.end(); }
 
-
-            /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */
-            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
-
-            /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
-            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
-
-            /** @brief Returns the unique ID of the class */
-            FORCEINLINE unsigned int getClassID() const { return this->classID_; }
-
             void addConfigValueContainer(const std::string& varname, ConfigValueContainer* container);
             ConfigValueContainer* getConfigValueContainer(const std::string& varname);
             ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
 
-            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
-
-            static void destroyAllIdentifiers();
 
         protected:
@@ -199,34 +216,25 @@
             static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
 
-            /** @brief Returns the map that stores all Identifiers. @return The map */
-            static std::map<std::string, Identifier*>& getIdentifierMapIntern();
+            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
+
+            /** @brief Returns the map that stores all Identifiers with their names. @return The map */
+            static std::map<std::string, Identifier*>& getStringIdentifierMapIntern();
             /** @brief Returns the map that stores all Identifiers with their names in lowercase. @return The map */
-            static std::map<std::string, Identifier*>& getLowercaseIdentifierMapIntern();
+            static std::map<std::string, Identifier*>& getLowercaseStringIdentifierMapIntern();
+            /** @brief Returns the map that stores all Identifiers with their network IDs. @return The map */
+            static std::map<uint32_t, Identifier*>& getIDIdentifierMapIntern();
 
             /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
-            inline std::set<const Identifier*>& getChildrenIntern() const { return (*this->children_); }
+            inline std::set<const Identifier*>& getChildrenIntern() const { return this->children_; }
             /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */
-            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
+            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return this->directChildren_; }
 
             ObjectListBase* objects_;                                      //!< The list of all objects of this class
 
         private:
-            /**
-                @brief Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
-            */
-            inline static void startCreatingHierarchy()
-            {
-                hierarchyCreatingCounter_s++;
-                COUT(4) << "*** Identifier: Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl;
-            }
-
-            /**
-                @brief Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.
-            */
-            inline static void stopCreatingHierarchy()
-            {
-                hierarchyCreatingCounter_s--;
-                COUT(4) << "*** Identifier: Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl;
-            }
+            /** @brief Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents. */
+            inline static void startCreatingHierarchy() { hierarchyCreatingCounter_s++; }
+            /** @brief Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents. */
+            inline static void stopCreatingHierarchy()  { hierarchyCreatingCounter_s--; }
 
             static std::map<std::string, Identifier*>& getTypeIDIdentifierMap();
@@ -235,13 +243,13 @@
 
             std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
-            std::set<const Identifier*>* children_;                        //!< The children of the class the Identifier belongs to
+            mutable std::set<const Identifier*> children_;                 //!< The children of the class the Identifier belongs to
 
             std::set<const Identifier*> directParents_;                    //!< The direct parents of the class the Identifier belongs to
-            std::set<const Identifier*>* directChildren_;                  //!< The direct children of the class the Identifier belongs to
+            mutable std::set<const Identifier*> directChildren_;           //!< The direct children of the class the Identifier belongs to
 
             bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
             bool bSetName_;                                                //!< True if the name is set
             std::string name_;                                             //!< The name of the class the Identifier belongs to
-            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
+            Factory* factory_;                                             //!< The Factory, able to create new objects of the given class (if available)
             static int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
             const unsigned int classID_;                                   //!< Uniquely identifies a class (might not be the same as the networkID_)
@@ -302,6 +310,6 @@
     inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
     {
-        // check if the static field has already been filled
-        if (ClassIdentifier<T>::classIdentifier_s == 0)
+        // check if the Identifier already exists
+        if (!ClassIdentifier<T>::classIdentifier_s)
             ClassIdentifier<T>::initialiseIdentifier();
 
@@ -430,129 +438,4 @@
 #endif
     }
-
-
-    // ###############################
-    // ###   SubclassIdentifier    ###
-    // ###############################
-    //! The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
-    /**
-        You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>.
-        If you assign something else, the program aborts.
-        Because we know the minimum type, a dynamic_cast is done, which makes it easier to create a new object.
-    */
-    template <class T>
-    class SubclassIdentifier
-    {
-        public:
-            /**
-                @brief Constructor: Automaticaly assigns the Identifier of the given class.
-            */
-            SubclassIdentifier()
-            {
-                this->identifier_ = ClassIdentifier<T>::getIdentifier();
-            }
-
-            /**
-                @brief Copyconstructor: Assigns the given Identifier.
-                @param identifier The Identifier
-            */
-            SubclassIdentifier(Identifier* identifier)
-            {
-                this->operator=(identifier);
-            }
-
-            /**
-                @brief Overloading of the = operator: assigns the identifier and checks its type.
-                @param identifier The Identifier to assign
-                @return The SubclassIdentifier itself
-            */
-            SubclassIdentifier<T>& operator=(Identifier* identifier)
-            {
-                if (!identifier || !identifier->isA(ClassIdentifier<T>::getIdentifier()))
-                {
-                    COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
-                    if (identifier)
-                    {
-                        COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
-                        COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
-                    }
-                    else
-                    {
-                        COUT(1) << "Error: Can't assign NULL identifier" << std::endl;
-                    }
-                }
-                else
-                {
-                    this->identifier_ = identifier;
-                }
-                return *this;
-            }
-
-            /**
-                @brief Overloading of the * operator: returns the assigned identifier.
-            */
-            inline Identifier* operator*() const
-            {
-                return this->identifier_;
-            }
-
-            /**
-                @brief Overloading of the -> operator: returns the assigned identifier.
-            */
-            inline Identifier* operator->() const
-            {
-                return this->identifier_;
-            }
-
-            /**
-                @brief Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.
-            */
-            inline operator Identifier*() const
-            {
-                return this->identifier_;
-            }
-
-            /**
-                @brief Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
-                @return The new object
-            */
-            T* fabricate(BaseObject* creator) const
-            {
-                BaseObject* newObject = this->identifier_->fabricate(creator);
-
-                // Check if the creation was successful
-                if (newObject)
-                {
-                    return orxonox_cast<T*>(newObject);
-                }
-                else
-                {
-                    // Something went terribly wrong
-                    if (this->identifier_)
-                    {
-                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
-                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
-                        COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
-                        COUT(1) << "Aborting..." << std::endl;
-                    }
-                    else
-                    {
-                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
-                        COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
-                        COUT(1) << "Aborting..." << std::endl;
-                    }
-
-                    assert(false);
-                    return 0;
-                }
-            }
-
-            /** @brief Returns the assigned identifier. @return The identifier */
-            inline Identifier* getIdentifier() const
-                { return this->identifier_; }
-
-        private:
-            Identifier* identifier_;            //!< The assigned identifier
-    };
 }
 
Index: sandbox/src/libraries/core/Iterator.h
===================================================================
--- sandbox/src/libraries/core/Iterator.h	(revision 5782)
+++ sandbox/src/libraries/core/Iterator.h	(revision 6038)
@@ -167,5 +167,4 @@
 
                 return (*this);
-                return *this;
             }
 
@@ -193,6 +192,5 @@
             inline const Iterator<T>& operator++()
             {
-                if (this->element_)
-                    this->element_ = this->element_->next_;
+                this->element_ = this->element_->next_;
                 return *this;
             }
@@ -205,6 +203,5 @@
             {
                 Iterator<T> copy = *this;
-                if (this->element_)
-                    this->element_ = this->element_->next_;
+                this->element_ = this->element_->next_;
                 return copy;
             }
@@ -216,6 +213,5 @@
             inline const Iterator<T>& operator--()
             {
-                if (this->element_)
-                    this->element_ = this->element_->prev_;
+                this->element_ = this->element_->prev_;
                 return *this;
             }
@@ -228,6 +224,5 @@
             {
                 Iterator<T> copy = *this;
-                if (this->element_)
-                    this->element_ = this->element_->prev_;
+                this->element_ = this->element_->prev_;
                 return copy;
             }
@@ -239,8 +234,5 @@
             inline T* operator*() const
             {
-                if (this->element_)
-                    return orxonox_cast<T*>(this->element_->objectBase_);
-                else
-                    return 0;
+                return orxonox_cast<T*>(this->element_->objectBase_);
             }
 
@@ -251,8 +243,5 @@
             inline T* operator->() const
             {
-                if (this->element_)
-                    return orxonox_cast<T*>(this->element_->objectBase_);
-                else
-                    return 0;
+                return orxonox_cast<T*>(this->element_->objectBase_);
             }
 
Index: sandbox/src/libraries/core/Language.cc
===================================================================
--- sandbox/src/libraries/core/Language.cc	(revision 5782)
+++ sandbox/src/libraries/core/Language.cc	(revision 6038)
@@ -35,8 +35,7 @@
 
 #include <fstream>
-#include <boost/filesystem.hpp>
-
 #include "util/Debug.h"
 #include "Core.h"
+#include "PathConfig.h"
 
 namespace orxonox
@@ -200,14 +199,14 @@
         COUT(4) << "Read default language file." << std::endl;
 
-        boost::filesystem::path filepath(Core::getConfigPath() / getFilename(this->defaultLanguage_));
+        std::string filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
 
         // This creates the file if it's not existing
         std::ofstream createFile;
-        createFile.open(filepath.string().c_str(), std::fstream::app);
+        createFile.open(filepath.c_str(), std::fstream::app);
         createFile.close();
 
         // Open the file
         std::ifstream file;
-        file.open(filepath.string().c_str(), std::fstream::in);
+        file.open(filepath.c_str(), std::fstream::in);
 
         if (!file.is_open())
@@ -249,9 +248,9 @@
         COUT(4) << "Read translated language file (" << Core::getLanguage() << ")." << std::endl;
 
-        boost::filesystem::path filepath(Core::getConfigPath() / getFilename(Core::getLanguage()));
+        std::string filepath = PathConfig::getConfigPathString() + getFilename(Core::getLanguage());
 
         // Open the file
         std::ifstream file;
-        file.open(filepath.string().c_str(), std::fstream::in);
+        file.open(filepath.c_str(), std::fstream::in);
 
         if (!file.is_open())
@@ -303,9 +302,9 @@
         COUT(4) << "Language: Write default language file." << std::endl;
 
-        boost::filesystem::path filepath(Core::getConfigPath() / getFilename(this->defaultLanguage_));
+        std::string filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
 
         // Open the file
         std::ofstream file;
-        file.open(filepath.string().c_str(), std::fstream::out);
+        file.open(filepath.c_str(), std::fstream::out);
 
         if (!file.is_open())
Index: sandbox/src/libraries/core/LuaState.cc
===================================================================
--- sandbox/src/libraries/core/LuaState.cc	(revision 5782)
+++ sandbox/src/libraries/core/LuaState.cc	(revision 6038)
@@ -38,5 +38,5 @@
 
 #include "util/Debug.h"
-#include "Core.h"
+#include "PathConfig.h"
 #include "ToluaBindCore.h"
 
@@ -106,5 +106,5 @@
     shared_ptr<ResourceInfo> LuaState::getFileInfo(const std::string& filename)
     {
-        boost::filesystem::path filepath = Core::getDataPath() / "lua" / filename;
+        boost::filesystem::path filepath = PathConfig::getDataPath() / "lua" / filename;
         if (boost::filesystem::exists(filepath))
         {
Index: sandbox/src/libraries/core/ObjectListIterator.h
===================================================================
--- sandbox/src/libraries/core/ObjectListIterator.h	(revision 5782)
+++ sandbox/src/libraries/core/ObjectListIterator.h	(revision 6038)
@@ -123,6 +123,5 @@
             inline const ObjectListIterator<T>& operator++()
             {
-                if (this->element_)
-                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
+                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
                 return *this;
             }
@@ -135,6 +134,5 @@
             {
                 ObjectListIterator<T> copy = *this;
-                if (this->element_)
-                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
+                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
                 return copy;
             }
@@ -146,6 +144,5 @@
             inline const ObjectListIterator<T>& operator--()
             {
-                if (this->element_)
-                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
+                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
                 return *this;
             }
@@ -158,6 +155,5 @@
             {
                 ObjectListIterator<T> copy = *this;
-                if (this->element_)
-                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
+                this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
                 return copy;
             }
@@ -169,8 +165,5 @@
             inline T* operator*() const
             {
-                if (this->element_)
-                    return this->element_->object_;
-                else
-                    return 0;
+                return this->element_->object_;
             }
 
@@ -181,8 +174,5 @@
             inline T* operator->() const
             {
-                if (this->element_)
-                    return this->element_->object_;
-                else
-                    return 0;
+                return this->element_->object_;
             }
 
Index: sandbox/src/libraries/core/OrxonoxClass.cc
===================================================================
--- sandbox/src/libraries/core/OrxonoxClass.cc	(revision 5782)
+++ sandbox/src/libraries/core/OrxonoxClass.cc	(revision 6038)
@@ -78,44 +78,4 @@
 
     /** @brief Returns true if the objects class is of the given type or a derivative. */
-    template <class B> bool OrxonoxClass::isA(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isA(identifier->getIdentifier()); }
-    /** @brief Returns true if the objects class is exactly of the given type. */
-    template <class B> bool OrxonoxClass::isExactlyA(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isExactlyA(identifier->getIdentifier()); }
-    /** @brief Returns true if the objects class is a child of the given type. */
-    template <class B> bool OrxonoxClass::isChildOf(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct child of the given type. */
-    template <class B> bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); }
-    /** @brief Returns true if the objects class is a parent of the given type. */
-    template <class B> bool OrxonoxClass::isParentOf(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct parent of the given type. */
-    template <class B> bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<B>* identifier)
-        { return this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); }
-
-
-    /** @brief Returns true if the objects class is of the given type or a derivative. */
-    template <class B> bool OrxonoxClass::isA(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isA(identifier.getIdentifier()); }
-    /** @brief Returns true if the objects class is exactly of the given type. */
-    template <class B> bool OrxonoxClass::isExactlyA(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isExactlyA(identifier.getIdentifier()); }
-    /** @brief Returns true if the objects class is a child of the given type. */
-    template <class B> bool OrxonoxClass::isChildOf(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct child of the given type. */
-    template <class B> bool OrxonoxClass::isDirectChildOf(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); }
-    /** @brief Returns true if the objects class is a parent of the given type. */
-    template <class B> bool OrxonoxClass::isParentOf(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct parent of the given type. */
-    template <class B> bool OrxonoxClass::isDirectParentOf(const SubclassIdentifier<B> identifier)
-        { return this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); }
-
-
-    /** @brief Returns true if the objects class is of the given type or a derivative. */
     bool OrxonoxClass::isA(const OrxonoxClass* object)
         { return this->getIdentifier()->isA(object->getIdentifier()); }
Index: sandbox/src/libraries/core/OrxonoxClass.h
===================================================================
--- sandbox/src/libraries/core/OrxonoxClass.h	(revision 5782)
+++ sandbox/src/libraries/core/OrxonoxClass.h	(revision 6038)
@@ -72,17 +72,16 @@
             bool isDirectParentOf(const Identifier* identifier);
 
-            template <class B> bool isA(const SubclassIdentifier<B>* identifier);
-            template <class B> bool isExactlyA(const SubclassIdentifier<B>* identifier);
-            template <class B> bool isChildOf(const SubclassIdentifier<B>* identifier);
-            template <class B> bool isDirectChildOf(const SubclassIdentifier<B>* identifier);
-            template <class B> bool isParentOf(const SubclassIdentifier<B>* identifier);
-            template <class B> bool isDirectParentOf(const SubclassIdentifier<B>* identifier);
-
-            template <class B> bool isA(const SubclassIdentifier<B> identifier);
-            template <class B> bool isExactlyA(const SubclassIdentifier<B> identifier);
-            template <class B> bool isChildOf(const SubclassIdentifier<B> identifier);
-            template <class B> bool isDirectChildOf(const SubclassIdentifier<B> identifier);
-            template <class B> bool isParentOf(const SubclassIdentifier<B> identifier);
-            template <class B> bool isDirectParentOf(const SubclassIdentifier<B> identifier);
+            template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
+                { return this->isA(*identifier); }
+            template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
+                { return this->isExactlyA(*identifier); }
+            template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
+                { return this->isChildOf(*identifier); }
+            template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
+                { return this->isDirectChildOf(*identifier); }
+            template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
+                { return this->isParentOf(*identifier); }
+            template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
+                { return this->isDirectParentOf(*identifier); }
 
             bool isA(const OrxonoxClass* object);
@@ -100,20 +99,20 @@
                 Returns NULL if the no pointer was found.
             */
-            template <class T>
-            FORCEINLINE T* getDerivedPointer(unsigned int classID)
+            FORCEINLINE void* getDerivedPointer(unsigned int classID)
             {
                 for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
                 {
                     if (this->objectPointers_[i].first == classID)
-                        return static_cast<T*>(this->objectPointers_[i].second);
+                        return this->objectPointers_[i].second;
                 }
                 return NULL;
             }
-            //! Const version of getDerivedPointer
-            template <class T>
-            FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
-            {
-                return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);
-            }
+
+            //! Version of getDerivedPointer with template
+            template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
+            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
+            //! Const version of getDerivedPointer with template
+            template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
+            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
 
         private:
Index: sandbox/src/libraries/core/PathConfig.cc
===================================================================
--- sandbox/src/libraries/core/PathConfig.cc	(revision 6038)
+++ sandbox/src/libraries/core/PathConfig.cc	(revision 6038)
@@ -0,0 +1,309 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PathConfig.h"
+
+#include <cassert>
+#include <cstdlib>
+#include <cstdio>
+#include <vector>
+#include <boost/version.hpp>
+#include <boost/filesystem.hpp>
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  include <windows.h>
+#  undef min
+#  undef max
+#elif defined(ORXONOX_PLATFORM_APPLE)
+#  include <sys/param.h>
+#  include <mach-o/dyld.h>
+#else /* Linux */
+#  include <sys/types.h>
+#  include <unistd.h>
+#endif
+
+#include "SpecialConfig.h"
+#include "util/Debug.h"
+#include "util/Exception.h"
+#include "CommandLineParser.h"
+
+// Boost 1.36 has some issues with deprecated functions that have been omitted
+#if (BOOST_VERSION == 103600)
+#  define BOOST_LEAF_FUNCTION filename
+#else
+#  define BOOST_LEAF_FUNCTION leaf
+#endif
+
+namespace orxonox
+{
+    namespace bf = boost::filesystem;
+
+    //! Static pointer to the singleton
+    PathConfig* PathConfig::singletonPtr_s  = 0;
+
+    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
+
+    PathConfig::PathConfig()
+        : rootPath_(*(new bf::path()))
+        , executablePath_(*(new bf::path()))
+        , modulePath_(*(new bf::path()))
+        , dataPath_(*(new bf::path()))
+        , configPath_(*(new bf::path()))
+        , logPath_(*(new bf::path()))
+        , bDevRun_(false)
+    {
+        //////////////////////////
+        // FIND EXECUTABLE PATH //
+        //////////////////////////
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
+        // get executable module
+        TCHAR buffer[1024];
+        if (GetModuleFileName(NULL, buffer, 1024) == 0)
+            ThrowException(General, "Could not retrieve executable path.");
+
+#elif defined(ORXONOX_PLATFORM_APPLE)
+        char buffer[1024];
+        unsigned long path_len = 1023;
+        if (_NSGetExecutablePath(buffer, &path_len))
+            ThrowException(General, "Could not retrieve executable path.");
+
+#else /* Linux */
+        /* written by Nicolai Haehnle <prefect_@gmx.net> */
+
+        /* Get our PID and build the name of the link in /proc */
+        char linkname[64]; /* /proc/<pid>/exe */
+        if (snprintf(linkname, sizeof(linkname), "/proc/%i/exe", getpid()) < 0)
+        {
+            /* This should only happen on large word systems. I'm not sure
+               what the proper response is here.
+               Since it really is an assert-like condition, aborting the
+               program seems to be in order. */
+            assert(false);
+        }
+
+        /* Now read the symbolic link */
+        char buffer[1024];
+        int ret;
+        ret = readlink(linkname, buffer, 1024);
+        /* In case of an error, leave the handling up to the caller */
+        if (ret == -1)
+            ThrowException(General, "Could not retrieve executable path.");
+
+        /* Ensure proper NUL termination */
+        buffer[ret] = 0;
+#endif
+
+        executablePath_ = bf::path(buffer);
+#ifndef ORXONOX_PLATFORM_APPLE
+        executablePath_ = executablePath_.branch_path(); // remove executable name
+#endif
+
+        /////////////////////
+        // SET MODULE PATH //
+        /////////////////////
+
+        if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
+        {
+            COUT(1) << "Running from the build tree." << std::endl;
+            PathConfig::bDevRun_ = true;
+            modulePath_ = specialConfig::moduleDevDirectory;
+        }
+        else
+        {
+
+#ifdef INSTALL_COPYABLE // --> relative paths
+
+            // Also set the root path
+            bf::path relativeExecutablePath(specialConfig::defaultRuntimePath);
+            rootPath_ = executablePath_;
+            while (!bf::equivalent(rootPath_ / relativeExecutablePath, executablePath_) && !rootPath_.empty())
+                rootPath_ = rootPath_.branch_path();
+            if (rootPath_.empty())
+                ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
+
+            // Module path is fixed as well
+            modulePath_ = rootPath_ / specialConfig::defaultModulePath;
+
+#else
+
+            // There is no root path, so don't set it at all
+            // Module path is fixed as well
+            modulePath_ = specialConfig::moduleInstallDirectory;
+
+#endif
+        }
+    }
+
+    PathConfig::~PathConfig()
+    {
+        delete &rootPath_;
+        delete &executablePath_;
+        delete &modulePath_;
+        delete &dataPath_;
+        delete &configPath_;
+        delete &logPath_;
+    }
+
+    void PathConfig::setConfigurablePaths()
+    {
+        if (bDevRun_)
+        {
+            dataPath_         = specialConfig::dataDevDirectory;
+            configPath_       = specialConfig::configDevDirectory;
+            logPath_          = specialConfig::logDevDirectory;
+        }
+        else
+        {
+
+#ifdef INSTALL_COPYABLE // --> relative paths
+
+            // Using paths relative to the install prefix, complete them
+            dataPath_   = rootPath_ / specialConfig::defaultDataPath;
+            configPath_ = rootPath_ / specialConfig::defaultConfigPath;
+            logPath_    = rootPath_ / specialConfig::defaultLogPath;
+
+#else
+
+            dataPath_  = specialConfig::dataInstallDirectory;
+
+            // Get user directory
+#  ifdef ORXONOX_PLATFORM_UNIX /* Apple? */
+            char* userDataPathPtr(getenv("HOME"));
+#  else
+            char* userDataPathPtr(getenv("APPDATA"));
+#  endif
+            if (userDataPathPtr == NULL)
+                ThrowException(General, "Could not retrieve user data path.");
+            bf::path userDataPath(userDataPathPtr);
+            userDataPath /= ".orxonox";
+
+            configPath_ = userDataPath / specialConfig::defaultConfigPath;
+            logPath_    = userDataPath / specialConfig::defaultLogPath;
+
+#endif
+
+        }
+
+        // Option to put all the config and log files in a separate folder
+        if (!CommandLineParser::getArgument("writingPathSuffix")->hasDefaultValue())
+        {
+            std::string directory(CommandLineParser::getValue("writingPathSuffix").getString());
+            configPath_ = configPath_ / directory;
+            logPath_    = logPath_    / directory;
+        }
+
+        // Create directories to avoid problems when opening files in non existent folders.
+        std::vector<std::pair<bf::path, std::string> > directories;
+        directories.push_back(std::make_pair(bf::path(configPath_), "config"));
+        directories.push_back(std::make_pair(bf::path(logPath_), "log"));
+
+        for (std::vector<std::pair<bf::path, std::string> >::iterator it = directories.begin();
+            it != directories.end(); ++it)
+        {
+            if (bf::exists(it->first) && !bf::is_directory(it->first))
+            {
+                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
+                                         Please remove " + it->first.string());
+            }
+            if (bf::create_directories(it->first)) // function may not return true at all (bug?)
+            {
+                COUT(4) << "Created " << it->second << " directory" << std::endl;
+            }
+        }
+    }
+
+    std::vector<std::string> PathConfig::getModulePaths()
+    {
+        std::vector<std::string> modulePaths;
+
+        // We search for helper files with the following extension
+        std::string moduleextension = specialConfig::moduleExtension;
+        size_t moduleextensionlength = moduleextension.size();
+
+        // Add that path to the PATH variable in case a module depends on another one
+        std::string pathVariable = getenv("PATH");
+        putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + modulePath_.string()).c_str()));
+
+        boost::filesystem::directory_iterator file(modulePath_);
+        boost::filesystem::directory_iterator end;
+
+        // Iterate through all files
+        while (file != end)
+        {
+            std::string filename = file->BOOST_LEAF_FUNCTION();
+
+            // Check if the file ends with the exension in question
+            if (filename.size() > moduleextensionlength)
+            {
+                if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
+                {
+                    // We've found a helper file
+                    std::string library = filename.substr(0, filename.size() - moduleextensionlength);
+                    modulePaths.push_back((modulePath_ / library).file_string());
+                }
+            }
+            ++file;
+        }
+
+        return modulePaths;
+    }
+
+    /*static*/ std::string PathConfig::getRootPathString()
+    {
+        return getInstance().rootPath_.string() + '/';
+    }
+
+    /*static*/ std::string PathConfig::getExecutablePathString()
+    {
+        return getInstance().executablePath_.string() + '/';
+    }
+
+    /*static*/ std::string PathConfig::getDataPathString()
+    {
+        return getInstance().dataPath_.string() + '/';
+    }
+
+    /*static*/ std::string PathConfig::getConfigPathString()
+    {
+        return getInstance().configPath_.string() + '/';
+    }
+
+    /*static*/ std::string PathConfig::getLogPathString()
+    {
+        return getInstance().logPath_.string() + '/';
+    }
+
+    /*static*/ std::string PathConfig::getModulePathString()
+    {
+        return getInstance().modulePath_.string() + '/';
+    }
+}
Index: sandbox/src/libraries/core/PathConfig.h
===================================================================
--- sandbox/src/libraries/core/PathConfig.h	(revision 6038)
+++ sandbox/src/libraries/core/PathConfig.h	(revision 6038)
@@ -0,0 +1,131 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PathConfig_H__
+#define _PathConfig_H__
+
+#include "CorePrereqs.h"
+
+#include <string>
+#include <vector>
+#include "util/Singleton.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The PathConfig class is a singleton used to configure different paths.
+    @details
+        The class provides information about the data, config, log, executable,
+        root and module path.
+        It determines those by the use of platform specific functions.
+    @remarks
+        Not all paths are always available:
+        - root only when installed copyable
+        - externalData only for development builds in the build tree
+    */
+    class _CoreExport PathConfig : public Singleton<PathConfig>
+    {
+        friend class Singleton<PathConfig>;
+        friend class Core;
+
+        public:
+            /**
+            @brief
+                Retrievs the executable path and sets all hard coded fixed paths (currently only the module path)
+                Also checks for "orxonox_dev_build.keep_me" in the executable diretory.
+                If found it means that this is not an installed run, hence we
+                don't write the logs and config files to ~/.orxonox
+            @throw
+                GeneralException
+            */
+            PathConfig();
+            ~PathConfig();
+
+            //! Returns the path to the root folder as boost::filesystem::path
+            static const boost::filesystem::path& getRootPath()
+                { return getInstance().rootPath_; }
+            //! Returns the path to the executable folder as boost::filesystem::path
+            static const boost::filesystem::path& getExecutablePath()
+                { return getInstance().executablePath_; }
+            //! Returns the path to the data files as boost::filesystem::path
+            static const boost::filesystem::path& getDataPath()
+                { return getInstance().dataPath_; }
+            //! Returns the path to the config files as boost::filesystem::path
+            static const boost::filesystem::path& getConfigPath()
+                { return getInstance().configPath_; }
+            //! Returns the path to the log files as boost::filesystem::path
+            static const boost::filesystem::path& getLogPath()
+                { return getInstance().logPath_; }
+            //! Returns the path to the modules as boost::filesystem::path
+            static const boost::filesystem::path& getModulePath()
+                { return getInstance().modulePath_; }
+
+            //! Returns the path to the root folder as std::string
+            static std::string getRootPathString();
+            //! Returns the path to the executable folder as std::string
+            static std::string getExecutablePathString();
+            //! Returns the path to the data files as std::string
+            static std::string getDataPathString();
+            //! Returns the path to the config files as std::string
+            static std::string getConfigPathString();
+            //! Returns the path to the log files as std::string
+            static std::string getLogPathString();
+            //! Returns the path to the modules as std::string
+            static std::string getModulePathString();
+
+            //! Return trrue for runs in the build directory (not installed)
+            static bool isDevelopmentRun() { return getInstance().bDevRun_; }
+
+        private:
+            PathConfig(const PathConfig&); //!< Don't use (undefined symbol)
+
+            /**
+            @brief
+                Sets config, log and media path and creates the folders if necessary.
+            @throws
+                GeneralException
+            */
+            void setConfigurablePaths();
+            //! Returns a list with all modules declared by a *.module file in the module folder.
+            std::vector<std::string> getModulePaths();
+
+            //! Path to the parent directory of the ones above if program was installed with relativ paths
+            boost::filesystem::path& rootPath_;
+            boost::filesystem::path& executablePath_;        //!< Path to the executable
+            boost::filesystem::path& modulePath_;            //!< Path to the modules
+            boost::filesystem::path& dataPath_;              //!< Path to the data files folder
+            boost::filesystem::path& configPath_;            //!< Path to the config files folder
+            boost::filesystem::path& logPath_;               //!< Path to the log files folder
+
+            bool                     bDevRun_;               //!< True for runs in the build directory (not installed)
+            static PathConfig* singletonPtr_s;
+    };
+}
+
+#endif /* _PathConfig_H__ */
