Index: src/ControllerCommand.hpp
===================================================================
--- src/ControllerCommand.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/*
- * ControllerCommand.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLERCOMMAND_HPP_
-#define CONTROLLERCOMMAND_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/function.hpp>
-#include <deque>
-#include <string>
-
-/** ControllerCommand associates a single name with a certain deque of
- *  (conntroller) commands.
- *
- * The ControllerCommand can be used as follows:
- * \code
- * ControllerCommand command;
- * for (ControllerCommand::const_iterator iter = command.begin();
- *    iter != command.end(); ++iter) {
- *    ...
- *    // execute current command
- *    (*iter)();
- *    ...
- * }
- * \endcode
- *
- */
-struct ControllerCommand
-{
-public:
-  //!> commands are simply bound functions
-  typedef boost::function<void ()> commands_t;
-  //!> typedef for deque with commands_t to execute
-  typedef std::deque<commands_t> queue_t;
-  //!> convenience constant iterator to queue_t
-  typedef std::deque<commands_t>::const_iterator const_iterator;
-
-  /** Constructor of class ControllerCommand.
-   *
-   * \param _name name of this command
-   * \param _commands command queue to associated with this command
-   */
-  ControllerCommand(const std::string &_name, const queue_t &_commands) :
-    name(_name),
-    commands(_commands)
-  {}
-  /** Destructor of class ControllerCommand.
-   *
-   */
-  ControllerCommand()
-  {}
-
-  /** Getter for begin of deque.
-   *
-   * \return iterator pointing at first command
-   */
-  const_iterator begin() const
-  { return commands.begin(); }
-
-  /** Getter for one after end of command deque.
-   *
-   * \return iterator at one position after last command
-   */
-  const_iterator end() const
-  { return commands.end(); }
-
-  /** Getter for internal name of this ControllerCommand.
-   *
-   * \note this is required for Repository pattern.
-   *
-   * \return name of this ControllerCommand
-   */
-  const std::string &getName() const
-  { return name; }
-
-private:
-  //!> name of this ControllerCommand
-  const std::string name;
-  //!> commands to execute
-  const queue_t commands;
-};
-
-#endif /* CONTROLLERCOMMAND_HPP_ */
Index: src/ControllerCommandRegistry.cpp
===================================================================
--- src/ControllerCommandRegistry.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * ControllerCommandRepository.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "ControllerCommandRegistry.hpp"
-
-#include "CodePatterns/Registry_impl.hpp"
-
-ControllerCommandRegistry::ControllerCommandRegistry()
-{}
-
-ControllerCommandRegistry::~ControllerCommandRegistry()
-{
-  cleanup();
-}
-
-CONSTRUCT_REGISTRY(ControllerCommand)
Index: src/ControllerCommandRegistry.hpp
===================================================================
--- src/ControllerCommandRegistry.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*
- * ControllerCommandRegistry.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLERCOMMANDREGISTRY_HPP_
-#define CONTROLLERCOMMANDREGISTRY_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string>
-
-#include "CodePatterns/Registry.hpp"
-
-#include "ControllerCommand.hpp"
-
-struct ControllerCommandRegistry : public Registry<ControllerCommand>
-{
-  ControllerCommandRegistry();
-  virtual ~ControllerCommandRegistry();
-};
-
-#endif /* CONTROLLERCOMMANDREGISTRY_HPP_ */
Index: src/ControllerOptions.cpp
===================================================================
--- src/ControllerOptions.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * ControllerOptions.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "ControllerOptions.hpp"
-
-#include "CodePatterns/Log.hpp"
-
-int ControllerOptions::parseServerPort(boost::program_options::variables_map &vm) {
-  if (vm.count("server")) {
-    server = vm["server"].as< std::string >();
-    serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
-    server = server.substr(0, server.find_last_of(':'));
-    try {
-      boost::lexical_cast<size_t>(serverport);
-    } catch (boost::bad_lexical_cast &) {
-      ELOG(1, "Could not interpret " << serverport << " as server:port.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
-  } else {
-    ELOG(1, "Requiring server's address (host:port) to connect to.");
-    return 255;
-  }
-  return 0;
-}
-
-int ControllerOptions::parseCommand(boost::program_options::variables_map &vm, const std::vector<std::string> &Commands) {
-  if (!vm.count("command")) {
-    ELOG(1, "Controller requires one of the following commands: "+toString(Commands));
-    return 255;
-  }
-  command = vm["command"].as< std::string >();
-  return 0;
-}
-
Index: src/ControllerOptions.hpp
===================================================================
--- src/ControllerOptions.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * ControllerOptions.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLEROPTIONS_HPP_
-#define CONTROLLEROPTIONS_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-#include <string>
-
-#include "DefaultOptions.hpp"
-
-
-struct ControllerOptions : public DefaultOptions
-{
-  int parseServerPort(boost::program_options::variables_map &vm);
-  int parseCommand(boost::program_options::variables_map &vm, const std::vector<std::string> &Commands);
-
-  std::string command;
-  std::string server;
-  std::string serverport;
-
-};
-
-
-#endif /* CONTROLLEROPTIONS_HPP_ */
Index: src/ControllerOptions_MPQCCommandJob.hpp
===================================================================
--- src/ControllerOptions_MPQCCommandJob.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ src/ControllerOptions_MPQCCommandJob.hpp	(revision 7da5cd8f40af510421808552471affe096db4402)
@@ -18,5 +18,5 @@
 #include <string>
 
-#include "ControllerOptions.hpp"
+#include "JobMarket/Controller/ControllerOptions.hpp"
 
 struct ControllerOptions_MPQCCommandJob : public ControllerOptions
Index: src/ControllerOptions_SystemCommandJob.cpp
===================================================================
--- src/ControllerOptions_SystemCommandJob.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * ControllerOptions_SystemCommandJob.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
-
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "CodePatterns/Log.hpp"
-
-#include "ControllerOptions_SystemCommandJob.hpp"
-
-int ControllerOptions_SystemCommandJob::parseExecutable(boost::program_options::variables_map &vm) {
-  if ((command == "createjobs") || (command == "addjobs")) {
-    if (!vm.count("executable")) {
-      ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
-      return 255;
-    }
-    executable = vm["executable"].as< std::string >();
-  }
-  return 0;
-}
-
-int ControllerOptions_SystemCommandJob::parseJobCommand(boost::program_options::variables_map &vm) {
-  if (command == "createjobs") {
-    if (!vm.count("jobcommand")) {
-      ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
-      return 255;
-    }
-    jobcommand = vm["jobcommand"].as< std::string >();
-  }
-  return 0;
-}
Index: src/ControllerOptions_SystemCommandJob.hpp
===================================================================
--- src/ControllerOptions_SystemCommandJob.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/*
- * ControllerOptions_SystemCommandJob.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_
-#define CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-#include <string>
-
-#include "ControllerOptions.hpp"
-
-struct ControllerOptions_SystemCommandJob : public ControllerOptions
-{
-  int parseExecutable(boost::program_options::variables_map &vm);
-  int parseJobCommand(boost::program_options::variables_map &vm);
-
-  std::string executable;
-  std::string jobcommand;
-};
-
-#endif /* CONTROLLEROPTIONS_SYSTEMCOMMANDJOB_HPP_ */
Index: src/DefaultOptions.cpp
===================================================================
--- src/DefaultOptions.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * DefaultOptions.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "DefaultOptions.hpp"
-
-#include "CodePatterns/Log.hpp"
-#include "CodePatterns/Verbose.hpp"
-
-int DefaultOptions::parseHelp(boost::program_options::variables_map &vm, const boost::program_options::options_description &desc) {
-  if (vm.count("help")) {
-    std::cout << desc << "\n";
-    return 1;
-  }
-  return 0;
-}
-int DefaultOptions::parseVerbosity(boost::program_options::variables_map &vm) {
-  if (vm.count("verbosity")) {
-    LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
-    setVerbosity(vm["verbosity"].as<size_t>());
-  } else {
-    LOG(0, "STATUS: Verbosity level was not set, defaulting to 5.");
-    setVerbosity(5);
-  }
-  return 0;
-}
-
Index: src/DefaultOptions.hpp
===================================================================
--- src/DefaultOptions.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
- * DefaultOptions.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef DEFAULTOPTIONS_HPP_
-#define DEFAULTOPTIONS_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-#include <string>
-
-struct DefaultOptions
-{
-  int parseHelp(boost::program_options::variables_map &vm, const boost::program_options::options_description &desc);
-  int parseVerbosity(boost::program_options::variables_map &vm);
-};
-
-
-#endif /* DEFAULTOPTIONS_HPP_ */
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ src/Makefile.am	(revision 7da5cd8f40af510421808552471affe096db4402)
@@ -258,5 +258,5 @@
 libmenu_a_SOURCES = ${UISOURCE} ${UIHEADER} 
 noinst_LIBRARIES = libmenu.a
-bin_PROGRAMS += molecuilder joiner analyzer Controller PoolWorker Server 
+bin_PROGRAMS += molecuilder joiner analyzer PoolWorker Server 
 EXTRA_PROGRAMS = unity
 
@@ -361,25 +361,10 @@
 CONTROLLERSOURCE = \
         controller_MPQCCommandJob.cpp \
-        ControllerCommandRegistry.cpp \
-        ControllerOptions.cpp \
-        ControllerOptions_MPQCCommandJob.cpp \
-        DefaultOptions.cpp
+        ControllerOptions_MPQCCommandJob.cpp
 
 CONTROLLERHEADER = \
-        controller_AddOn.hpp \
         controller_MPQCCommandJob.hpp \
-        ControllerCommand.hpp \
-        ControllerCommandRegistry.hpp \
-        ControllerOptions.hpp \
-        ControllerOptions_MPQCCommandJob.hpp \
-        DefaultOptions.hpp
-
-EXTRA_DIST += \
-	controller_AddOn_SystemCommandJob.cpp \
-        controller_SystemCommandJob.cpp \
-        controller_SystemCommandJob.hpp \
-        ControllerOptions_SystemCommandJob.cpp \
-        ControllerOptions_SystemCommandJob.hpp
-	
+        ControllerOptions_MPQCCommandJob.hpp
+
 
 noinst_LTLIBRARIES += libFragmentationAutomationController.la
@@ -390,78 +375,39 @@
         $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la
 
-POOLWORKERSOURCE = \
-        DefaultOptions.cpp \
-        SignalHandler.cpp \
-        SignalOptions.cpp \
-        WorkerOptions.cpp
-
-POOLWORKERHEADER = \
-        DefaultOptions.hpp \
-        SignalHandler.hpp \
-        SignalOptions.hpp \
-        WorkerOptions.hpp
-
-lib_LTLIBRARIES += libFragmentationAutomationPoolWorker.la
-libFragmentationAutomationPoolWorker_la_includedir = $(includedir)/MoleCuilder/JobMarket
-nobase_libFragmentationAutomationPoolWorker_la_include_HEADERS = $(POOLWORKERHEADER)
-libFragmentationAutomationPoolWorker_la_SOURCES = $(POOLWORKERSOURCE)
-libFragmentationAutomationPoolWorker_la_LIBADD = \
-        $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la
-
-SERVERSOURCE = \
-        DefaultOptions.cpp \
-        ServerOptions.cpp \
-        SignalHandler.cpp \
-        SignalOptions.cpp
-
-SERVERHEADER = \
-        DefaultOptions.hpp \
-        ServerOptions.hpp \
-        SignalHandler.hpp \
-        SignalOptions.hpp
-
-noinst_LTLIBRARIES += libFragmentationAutomationServer.la
-libFragmentationAutomationServer_la_includedir = $(includedir)/MoleCuilder/JobMarket
-nobase_libFragmentationAutomationServer_la_include_HEADERS = $(SERVERHEADER)
-libFragmentationAutomationServer_la_SOURCES = $(SERVERSOURCE)
-libFragmentationAutomationServer_la_LIBADD = \
-        $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la
-
 bin_PROGRAMS += Controller PoolWorker Server
 
-Controller_SOURCES = controller.cpp controller_main.cpp controller_main.hpp controller_AddOn_MPQCCommandJob.cpp
-Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS)
+Controller_SOURCES = controller.cpp controller_AddOn_MPQCCommandJob.cpp
+Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) ${CodePatterns_LDFLAGS}
 Controller_CXXFLAGS = $(AM_CPPFLAGS)
 Controller_LDADD = \
+	libFragmentationAutomationController.la \
         libMolecuilderJobs.la \
-        libFragmentationAutomationController.la \
 	libMolecuilderFragmentation.la \
 	libMolecuilderHelpers.la \
+        $(top_builddir)/JobMarket/src/JobMarket/libJobMarketController.la \
         $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la \
         $(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
-	${CodePatterns_LIBS} \
-	$(BOOST_PROGRAM_OPTIONS_LIBS)
-
-PoolWorker_SOURCES = poolworker.cpp poolworker_main.cpp poolworker_main.hpp
-PoolWorker_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS)
+	$(BOOST_PROGRAM_OPTIONS_LIBS) \
+	${CodePatterns_LIBS}
+
+PoolWorker_SOURCES = poolworker.cpp 
+PoolWorker_LDFLAGS = $(AM_LDFLAGS) ${CodePatterns_LDFLAGS}
 PoolWorker_CXXFLAGS = $(AM_CPPFLAGS)
 PoolWorker_LDADD = \
         libMolecuilderJobs.la \
-        libFragmentationAutomationPoolWorker.la \
+        $(top_builddir)/JobMarket/src/JobMarket/libJobMarketPoolWorker.la \
         $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la \
         $(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
-	${CodePatterns_LIBS} \
-	$(BOOST_PROGRAM_OPTIONS_LIBS)
-
-Server_SOURCES = Server.cpp server_main.cpp server_main.hpp
-Server_LDFLAGS = $(AM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS)
+	${CodePatterns_LIBS}
+
+Server_SOURCES = Server.cpp 
+Server_LDFLAGS = $(AM_LDFLAGS) ${CodePatterns_LDFLAGS}
 Server_CXXFLAGS = $(AM_CPPFLAGS)
 Server_LDADD = \
         libMolecuilderJobs.la \
-        libFragmentationAutomationServer.la \
+        $(top_builddir)/JobMarket/src/JobMarket/libJobMarketServer.la \
         $(top_builddir)/JobMarket/src/JobMarket/libJobMarket.la \
         $(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
-	${CodePatterns_LIBS} \
-	$(BOOST_PROGRAM_OPTIONS_LIBS)
+	${CodePatterns_LIBS}
 
 
Index: src/ServerOptions.cpp
===================================================================
--- src/ServerOptions.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * ServerOptions.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "ServerOptions.hpp"
-
-#include "CodePatterns/Log.hpp"
-
-int ServerOptions::parseWorkerPort(boost::program_options::variables_map &vm)
-{
-  if (vm.count("workerport")) {
-    try {
-      workerport = vm["workerport"].as< unsigned short >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << workerport << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << workerport << " as listen port for worker.");
-  } else {
-    ELOG(1, "Requiring listen port for worker.");
-    return 255;
-  }
-  return 0;
-}
-
-int ServerOptions::parseControllerPort(boost::program_options::variables_map &vm)
-{
-  if (vm.count("controllerport")) {
-    try {
-      controllerport = vm["controllerport"].as< unsigned short >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << controllerport << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << controllerport << " as listen port for controller.");
-  } else {
-    ELOG(1, "Requiring listen port for controller.");
-    return 255;
-  }
-  return 0;
-}
Index: src/ServerOptions.hpp
===================================================================
--- src/ServerOptions.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
- * ServerOptions.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef SERVEROPTIONS_HPP_
-#define SERVEROPTIONS_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-
-#include "DefaultOptions.hpp"
-#include "SignalOptions.hpp"
-
-struct ServerOptions : public DefaultOptions, public SignalOptions
-{
-  int parseWorkerPort(boost::program_options::variables_map &vm);
-  int parseControllerPort(boost::program_options::variables_map &vm);
-
-  unsigned short workerport;
-  unsigned short controllerport;
-};
-
-
-#endif /* SERVEROPTIONS_HPP_ */
Index: src/SignalHandler.cpp
===================================================================
--- src/SignalHandler.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * SignalHandler.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <signal.h>
-
-#include "CodePatterns/Log.hpp"
-
-#include "SignalHandler.hpp"
-  
-boost::function<void (int)> SignalHandler::signalhandler_fct = 0;
-
-void signalhandler(int sig) {
-  SignalHandler::signalhandler_fct(sig);
-}
-
-SignalHandler::SignalHandler(boost::function<void (int)> &_shutdownfunction, std::vector<size_t> &_signals) :
-  shutdownfunction(_shutdownfunction),
-  signals(_signals),
-  NoSignalsReceived(0),
-  MAX_NOSIGNALSRECEIVED(3)
-{
-  if (!signalhandler_fct)
-    signalhandler_fct = boost::bind(&SignalHandler::operator(), this, _1);
-  obtainAllHooks();
-}
-
-SignalHandler::~SignalHandler()
-{
-  releaseAllHooks();
-}
-
-void SignalHandler::operator()(int sig)
-{
-  // increment received signal counter
-  ++NoSignalsReceived;
-
-  // shutdown if we have handler
-  if (shutdownfunction)
-    shutdownfunction(sig);
-
-  if (NoSignalsReceived >= MAX_NOSIGNALSRECEIVED)
-    releaseAllHooks();
-}
-
-void SignalHandler::obtainAllHooks()
-{
-  for (std::vector<size_t>::const_iterator iter = signals.begin();
-      iter != signals.end(); ++iter) {
-    LOG(0, "STATUS: Catching signal " << *iter << " via signal handler.");
-    signal(*iter, signalhandler);
-  }
-}
-
-void SignalHandler::releaseAllHooks()
-{
-  // release signal hook again
-  for (std::vector<size_t>::const_iterator iter = signals.begin();
-      iter != signals.end(); ++iter)
-    signal(*iter, NULL);
-  signals.clear();
-}
Index: src/SignalHandler.hpp
===================================================================
--- src/SignalHandler.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*
- * SignalHandler.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef SIGNALHANDLER_HPP_
-#define SIGNALHANDLER_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/function.hpp>
-#include <vector>
-
-struct SignalHandler
-{
-  /** Constructor for class SignalHandler.
-   *
-   * \param _shutdownfunction function to call when signal has been received.
-   * \param _signals vector of all signals to catch
-   */
-  SignalHandler(boost::function<void (int)> &_shutdownfunction, std::vector<size_t> &_signals);
-  /** Destructor for class SignalHandler.
-   *
-   */
-  ~SignalHandler();
-
-private:
-  /** Obtains all signals in \a signals.
-   *
-   */
-  void obtainAllHooks();
-
-  /** Releases all signal hooks.
-   *
-   */
-  void releaseAllHooks();
-
-  /** Internal signal handler for a  \a sig
-   *
-   * \param sig signal to catch
-   */
-  void operator()(int sig);
-
-private:
-  //!> shutdown function to call on signal
-  boost::function<void (int)> shutdownfunction;
-  //!> signal vector for later releasing
-  std::vector<size_t> signals;
-  //!> counter for the number of received signals
-  size_t NoSignalsReceived;
-  //!> maximum number of received signals after which the handlers are released
-  const size_t MAX_NOSIGNALSRECEIVED;
-
-  //!> grant global function signalhandler access to private signalhandler function
-  friend void signalhandler(int sig);
-  //!> static function to be called by global function signalhandler
-  static boost::function<void (int)> signalhandler_fct;
-};
-
-
-#endif /* SIGNALHANDLER_HPP_ */
Index: src/SignalOptions.cpp
===================================================================
--- src/SignalOptions.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * SignalOptions.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "SignalOptions.hpp"
-
-#include "CodePatterns/Log.hpp"
-
-int SignalOptions::parseSignals(boost::program_options::variables_map &vm)
-{
-  if (vm.count("signal")) {
-    signals =  vm["signal"].as< std::vector<size_t> >();
-  } else {
-    LOG(0, "STATUS: No signals are caught.");
-  }
-  return 0;
-}
Index: src/SignalOptions.hpp
===================================================================
--- src/SignalOptions.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/*
- * SignalOptions.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef SIGNALOPTIONS_HPP_
-#define SIGNALOPTIONS_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-#include <vector>
-
-struct SignalOptions {
-  int parseSignals(boost::program_options::variables_map &vm);
-
-  std::vector<size_t> signals;
-};
-
-#endif /* SIGNALOPTIONS_HPP_ */
Index: src/WorkerOptions.cpp
===================================================================
--- src/WorkerOptions.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,78 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * WorkerOptions.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "WorkerOptions.hpp"
-
-#include <unistd.h>
-
-#include "CodePatterns/Log.hpp"
-
-int WorkerOptions::parseServer(boost::program_options::variables_map &vm) {
-  if (vm.count("server")) {
-    server = vm["server"].as< std::string >();
-    serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
-    server = server.substr(0, server.find_last_of(':'));
-    try {
-      boost::lexical_cast<size_t>(serverport);
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not interpret " << serverport << " as server:port.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
-  } else {
-    ELOG(1, "Requiring server's address (host:port) to connect to.");
-    return 255;
-  }
-  return 0;
-}
-
-int WorkerOptions::parseLocalhost(boost::program_options::variables_map &vm) {
-  if (vm.count("hostname")) {
-    hostname = vm["hostname"].as< std::string >();
-    LOG(1, "INFO: Using " << hostname << " as host's name.");
-  } else {
-    char name[1024];
-    if (gethostname(name, 1023) == 0) {
-      hostname = name;
-      LOG(1, "INFO: Using obtained hostname " << hostname << ".");
-    } else {
-      ELOG(1, "No hostname given and failed to determine automatically.");
-      return 255;
-    }
-  }
-  return 0;
-}
-
-int WorkerOptions::parseListenPort(boost::program_options::variables_map &vm) {
-  if (vm.count("listen")) {
-    try {
-      listenport = vm["listen"].as< std::string >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << vm["listen"].as< std::string >() << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using port " << listenport << " to listen to server connects.");
-  } else {
-    ELOG(1, "Requiring port to listen on .");
-    return 255;
-  }
-  return 0;
-}
Index: src/WorkerOptions.hpp
===================================================================
--- src/WorkerOptions.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/*
- * WorkerOptions.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef WORKEROPTIONS_HPP_
-#define WORKEROPTIONS_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/program_options.hpp>
-#include <string>
-
-#include "DefaultOptions.hpp"
-#include "SignalOptions.hpp"
-
-struct WorkerOptions : public DefaultOptions, public SignalOptions
-{
-  WorkerOptions() :
-    hostname("localhost")
-  {}
-
-  int parseServer(boost::program_options::variables_map &vm);
-  int parseLocalhost(boost::program_options::variables_map &vm);
-  int parseListenPort(boost::program_options::variables_map &vm);
-
-  std::string server;
-  std::string serverport;
-  std::string hostname;
-  std::string listenport;
-};
-
-#endif /* WORKEROPTIONS_HPP_ */
Index: src/controller.cpp
===================================================================
--- src/controller.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ src/controller.cpp	(revision 7da5cd8f40af510421808552471affe096db4402)
@@ -21,5 +21,5 @@
 #include "CodePatterns/MemDebug.hpp"
 
-#include "controller_main.hpp"
+#include "JobMarket/Controller/controller_main.hpp"
 
 int main(int argc, char* argv[])
Index: src/controller_AddOn.hpp
===================================================================
--- src/controller_AddOn.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/*
- * controller_AddOn.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLER_ADDON_HPP_
-#define CONTROLLER_ADDON_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include <boost/function.hpp>
-#include <boost/program_options.hpp>
-
-class ControllerCommand;
-class ControllerCommandRegistry;
-class ControllerInfo;
-class ControllerOptions;
-class FragmentController;
-
-struct controller_AddOn;
-
-/** This is the allocator function for the specific controller addon structure.
- *
- * The implementation should reside in its own module such that it can be
- * linked in unison with the \file controller.cpp and the derived implementation
- * of controller_AddOn to the executable controller.
- */
-extern "C++" controller_AddOn *getAddOn();
-
-/** This is the structure that contains functions to extend the functionality
- * of the basic controller with respect to certain jobs and commands.
- *
- * Here, we have four types of functions:
- * -# Allocator: Required to allocate to specific function which contains
- *    extended member variables and parsing functions.
- * -# Commands: Add more commands to the registry of the controller.
- * -# Options: Add more command-line options to require additional information
- *    from the user.
- * -# Parsers: Add parsing function to place parameter from command-line
- *    into internal structure allocated via Allocator.
- *
- * The allocated structure is the one which contains all information for the
- * execution of these commands. Note that some defaults are already parsed
- * and stored therein by the controller by default.
- *
- * \note All these functions are called within the basic controller, hence
- * all parameters are instances of this basic controller.
- */
-struct controller_AddOn {
-  /** Function to allocate a derived variant of ControllerOptions which might
-   * be extended by own member variables and parsing functions.
-   *
-   * \return Pointer to allocated instance of ControllerOptions or derived.
-   */
-  virtual ControllerOptions *allocateControllerInfo()=0;
-
-  /** Function to register new commands communicating with a server.
-   *
-   * \param registrator registrator function for the generated ControllerCommand
-   * \param controller access to controller to bind to its functions
-   * \param ControllerInfo All other options of the controller
-   */
-  virtual void addSpecificCommands(
-      boost::function<void (ControllerCommand *)> &registrator,
-      FragmentController &controller,
-      ControllerOptions &ControllerInfo)=0;
-
-  /** Function to add other command line options if more use input is required.
-   *
-   * \param option option_description entity that can be used to add another
-   *  boost::program_options as follows:
-   *  \code
-   *   option("command,c", boost::program_options::, "description");
-   *  \endcode
-   */
-  virtual void addSpecificOptions(
-      boost::program_options::options_description_easy_init option)=0;
-
-  /** Function to add a parsing function for placing info from the command line
-   * option into \a ControllerInfo.
-   *
-   * \param ControllerInfo May be reinterpret_cast to true type as has been
-   * allocated in controller_AddOn::allocateControllerInfo.
-   * \param vm map of command line variables
-   * \return 0 - ok, else - some failure code (which leads to program exit)
-   */
-  virtual int addOtherParsings(
-      ControllerOptions &ControllerInfo,
-      boost::program_options::variables_map &vm)=0;
-};
-
-#endif /* CONTROLLER_ADDON_HPP_ */
Index: src/controller_AddOn_SystemCommandJob.cpp
===================================================================
--- src/controller_AddOn_SystemCommandJob.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * controller_AddOn_SystemCommandJob.cpp
- *
- *  Created on: 04.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "controller_SystemCommandJob.hpp"
-
-struct controller_AddOn;
-
-controller_AddOn *getAddOn()
-{
-  return new controller_SystemCommandJob();
-}
Index: src/controller_MPQCCommandJob.cpp
===================================================================
--- src/controller_MPQCCommandJob.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ src/controller_MPQCCommandJob.cpp	(revision 7da5cd8f40af510421808552471affe096db4402)
@@ -29,11 +29,12 @@
 #include <fstream>
 
-#include "FragmentController.hpp"
-#include "Jobs/MPQCCommandJob.hpp"
-#include "Results/FragmentResult.hpp"
-
-#include "ControllerCommand.hpp"
-#include "ControllerCommandRegistry.hpp"
-#include "ControllerOptions_MPQCCommandJob.hpp"
+#include "CodePatterns/Info.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "JobMarket/Controller/ControllerCommand.hpp"
+#include "JobMarket/Controller/ControllerCommandRegistry.hpp"
+#include "JobMarket/Controller/FragmentController.hpp"
+#include "JobMarket/Jobs/FragmentJob.hpp"
+#include "JobMarket/Results/FragmentResult.hpp"
 
 #include "Fragmentation/EnergyMatrix.hpp"
@@ -47,4 +48,5 @@
 #include "Jobs/MPQCCommandJob_MPQCData.hpp"
 
+#include "ControllerOptions_MPQCCommandJob.hpp"
 
 /** Creates a MPQCCommandJob with argument \a filename.
Index: src/controller_MPQCCommandJob.hpp
===================================================================
--- src/controller_MPQCCommandJob.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ src/controller_MPQCCommandJob.hpp	(revision 7da5cd8f40af510421808552471affe096db4402)
@@ -17,5 +17,5 @@
 #include <boost/program_options.hpp>
 
-#include "controller_AddOn.hpp"
+#include "JobMarket/Controller/controller_AddOn.hpp"
 
 class ControllerCommand;
Index: src/controller_SystemCommandJob.cpp
===================================================================
--- src/controller_SystemCommandJob.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * controller_SystemCommandJob.cpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "controller_SystemCommandJob.hpp"
-
-#include <boost/assign.hpp>
-#include <boost/bind.hpp>
-
-#include "FragmentController.hpp"
-#include "Jobs/SystemCommandJob.hpp"
-#include "Results/FragmentResult.hpp"
-
-#include "ControllerCommand.hpp"
-#include "ControllerCommandRegistry.hpp"
-#include "ControllerOptions_SystemCommandJob.hpp"
-
-/** Print received results.
- *
- * @param results received results to print
- */
-void printReceivedResults(const std::vector<FragmentResult::ptr> &results)
-{
-  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
-      iter != results.end(); ++iter)
-    LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
-}
-
-/** Creates a SystemCommandJob out of give \a command with \a argument.
- *
- * @param controller reference to controller to add jobs
- * @param ControllerInfo information on the job
- */
-void createJobs(FragmentController &controller, const ControllerOptions_SystemCommandJob &ControllerInfo)
-{
-  const JobId_t next_id = controller.getAvailableId();
-  LOG(2, "DEBUG: Creating new SystemCommandJob with '"
-      +toString(ControllerInfo.executable)+"' and argument '"
-      +toString(ControllerInfo.jobcommand)+"'.");
-  FragmentJob::ptr testJob(
-      new SystemCommandJob(ControllerInfo.executable, ControllerInfo.jobcommand, next_id) );
-  std::vector<FragmentJob::ptr> jobs;
-  jobs.push_back(testJob);
-  controller.addJobs(jobs);
-  controller.sendJobs(ControllerInfo.server, ControllerInfo.serverport);
-  LOG(1, "INFO: Added one SystemCommandJob.");
-}
-
-inline std::vector<std::string> getListOfCommands(const ControllerCommandRegistry &ControllerCommands)
-{
-  std::vector<std::string> Commands;
-  for (ControllerCommandRegistry::const_iterator iter = ControllerCommands.getBeginIter();
-      iter != ControllerCommands.getEndIter(); ++iter)
-    Commands.push_back(iter->first);
-
-  return Commands;
-}
-
-ControllerOptions *controller_SystemCommandJob::allocateControllerInfo()
-{
-  return new ControllerOptions_SystemCommandJob();
-}
-
-void controller_SystemCommandJob::addSpecificCommands(
-    boost::function<void (ControllerCommand *)> &registrator,
-    FragmentController &controller,
-    ControllerOptions &ControllerInfo)
-{
-  ControllerOptions_SystemCommandJob &CI =
-      reinterpret_cast<ControllerOptions_SystemCommandJob &>(ControllerInfo);
-  registrator(new ControllerCommand("createjobs",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::requestIds,
-            boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport), 1))
-        (boost::bind(&createJobs, boost::ref(controller), boost::cref(CI)))
-      ));
-  registrator(new ControllerCommand("receiveresults",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::receiveResults,
-            boost::ref(controller), boost::cref(ControllerInfo.server), boost::cref(ControllerInfo.serverport)))
-        (boost::bind(&printReceivedResults,
-            boost::bind(&FragmentController::getReceivedResults, boost::ref(controller))))
-      ));
-}
-
-void controller_SystemCommandJob::addSpecificOption(
-    boost::program_options::options_description_easy_init option)
-{
-  option
-    ("jobcommand", boost::program_options::value< std::string >(), "command argument for executable for 'createjobs'")
-    ("executable", boost::program_options::value< std::string >(), "executable for commands 'createjobs'")
-    ;
-}
-
-int controller_SystemCommandJob::addOtherParsings(
-    ControllerOptions &ControllerInfo,
-    boost::program_options::variables_map &vm)
-{
-  ControllerOptions_SystemCommandJob &CI =
-      reinterpret_cast<ControllerOptions_SystemCommandJob &>(ControllerInfo);
-  int status = 0;
-  status = CI.parseExecutable(vm);
-  if (status) return status;
-  status = CI.parseJobCommand(vm);
-  return status;
-}
Index: src/controller_SystemCommandJob.hpp
===================================================================
--- src/controller_SystemCommandJob.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * controller_SystemCommandJob.hpp
- *
- *  Created on: 01.06.2012
- *      Author: heber
- */
-
-#ifndef CONTROLLER_SYSTEMCOMMANDJOB_HPP_
-#define CONTROLLER_SYSTEMCOMMANDJOB_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/function.hpp>
-#include <boost/program_options.hpp>
-
-#include "controller_AddOn.hpp"
-
-class ControllerCommand;
-class ControllerCommandRegistry;
-class ControllerInfo;
-class ControllerOptions;
-class FragmentController;
-
-struct controller_SystemCommandJob : public controller_AddOn
-{
-  ControllerOptions *allocateControllerInfo();
-
-  void addSpecificCommands(
-      boost::function<void (ControllerCommand *)> &registrator,
-      FragmentController &controller,
-      ControllerOptions &ControllerInfo);
-
-  void addSpecificOptions(
-      boost::program_options::options_description_easy_init option);
-
-  int addOtherParsings(
-      ControllerOptions &ControllerInfo,
-      boost::program_options::variables_map &vm);
-};
-
-#endif /* CONTROLLER_SYSTEMCOMMANDJOB_HPP_ */
Index: src/controller_main.cpp
===================================================================
--- src/controller_main.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,170 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2011 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file controller_main.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see client.cpp)
- *
- *  Created on: Nov 27, 2011
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <boost/assign.hpp>
-#include <boost/program_options.hpp>
-#include <deque>
-#include <fstream>
-#include <iostream>
-#include <map>
-#include <sstream>
-#include <streambuf>
-#include <vector>
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "atexit.hpp"
-#include "FragmentController.hpp"
-
-#include "ControllerOptions_SystemCommandJob.hpp"
-#include "ControllerCommandRegistry.hpp"
-
-#include "controller_AddOn.hpp"
-
-/** Print the status of scheduled and done jobs.
- *
- * @param status pair of number of schedule and done jobs
- */
-void printJobStatus(const std::pair<size_t, size_t> &JobStatus)
-{
-  LOG(1, "INFO: #" << JobStatus.first << " are waiting in the queue and #"
-      << JobStatus.second << " jobs are calculated so far.");
-}
-
-inline std::vector<std::string> getListOfCommands(const ControllerCommandRegistry &ControllerCommands)
-{
-  std::vector<std::string> Commands;
-  for (ControllerCommandRegistry::const_iterator iter = ControllerCommands.getBeginIter();
-      iter != ControllerCommands.getEndIter(); ++iter)
-    Commands.push_back(iter->first);
-
-  return Commands;
-}
-
-int controller_main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deeinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  size_t Exitflag = 0;
-
-  controller_AddOn *AddOn = getAddOn();
-  ASSERT(AddOn != NULL,
-      "main() - returned AddOn is NULL.");
-
-  ControllerOptions *ControllerInfo = AddOn->allocateControllerInfo();
-  boost::asio::io_service io_service;
-  FragmentController controller(io_service);
-  boost::program_options::variables_map vm;
-
-  // prepare ControllerCommand
-  // note: we need "< ControllerCommand::commands_t >" because parseExecutable(),... return int
-  // in contrast to other functions that return void
-  ControllerCommandRegistry ControllerCommands;
-  boost::function<void (ControllerCommand *)> registrator =
-      (boost::bind(&Registry<ControllerCommand>::registerInstance, boost::ref(ControllerCommands), _1));
-  registrator(new ControllerCommand("checkresults",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::checkResults,
-            boost::ref(controller), boost::cref(ControllerInfo->server), boost::cref(ControllerInfo->serverport)))
-        (boost::bind(&printJobStatus,
-            boost::bind(&FragmentController::getJobStatus, boost::ref(controller))))
-      ));
-  registrator(new ControllerCommand("removeall",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::removeall,
-            boost::ref(controller), boost::cref(ControllerInfo->server), boost::cref(ControllerInfo->serverport)))
-      ));
-  registrator(new ControllerCommand("shutdown",
-      boost::assign::list_of< ControllerCommand::commands_t >
-        (boost::bind(&FragmentController::shutdown,
-            boost::ref(controller), boost::cref(ControllerInfo->server), boost::cref(ControllerInfo->serverport)))
-      ));
-  AddOn->addSpecificCommands(registrator, controller, *ControllerInfo);
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("server", boost::program_options::value< std::string >(), "connect to server at this address (host:port)")
-      ("command", boost::program_options::value< std::string >(), (std::string("command to send to server: ")+toString(getListOfCommands(ControllerCommands))).c_str())
-  ;
-  AddOn->addSpecificOptions(desc.add_options());
-
-  // parse command line
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  // set controller information
-  int status = 0;
-  status = ControllerInfo->parseHelp(vm, desc);
-  if (status) return status;
-  status = ControllerInfo->parseVerbosity(vm);
-  if (status) return status;
-  status = ControllerInfo->parseServerPort(vm);
-  if (status) return status;
-  status = ControllerInfo->parseCommand(vm, getListOfCommands(ControllerCommands));
-  if (status) return status;
-
-  // all later parse functions depend on parsed command
-  status = AddOn->addOtherParsings(*ControllerInfo, vm);
-  if (status) return status;
-
-  // parse given ControllerCommand
-  if(!ControllerCommands.isPresentByName(ControllerInfo->command)) {
-    ELOG(1, "Unrecognized command '"+toString(ControllerInfo->command)+"'.");
-    return 255;
-  }
-  const ControllerCommand *commands = ControllerCommands.getByName(ControllerInfo->command);
-  try
-  {
-    // execute each command in the queue synchronously
-    size_t phase = 1;
-    for (ControllerCommand::const_iterator iter = commands->begin();
-       iter != commands->end(); ++iter) {
-      (*iter)();
-      {
-        io_service.reset();
-        Info info((std::string("io_service: ")+toString(phase)).c_str());
-        io_service.run();
-      }
-    }
-    Exitflag = controller.getExitflag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-  delete AddOn;
-
-  return Exitflag;
-}
-
Index: src/controller_main.hpp
===================================================================
--- src/controller_main.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,18 +1,0 @@
-/*
- * \file controller_main.hpp
- *
- *  Created on: Jun 04, 2012
- *      Author: heber
- */
-
-#ifndef CONTROLLER_MAIN_HPP_
-#define CONTROLLER_MAIN_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int controller_main(int argc, char **argv);
-
-#endif /* CONTROLLER_MAIN_HPP_ */
Index: src/poolworker_main.cpp
===================================================================
--- src/poolworker_main.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,103 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file poolworker_main.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see client.cpp)
- *
- *  Created on: Feb 28, 2012
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <iostream>
-#include <boost/program_options.hpp>
-#include <boost/lexical_cast.hpp>
-#include <vector>
-
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "atexit.hpp"
-#include "Pool/PoolWorker.hpp"
-#include "Jobs/SystemCommandJob.hpp"
-#include "SignalHandler.hpp"
-#include "WorkerOptions.hpp"
-
-int poolworker_main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deeinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  WorkerOptions WorkerOpts;
-  boost::program_options::variables_map vm;
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("signal", boost::program_options::value< std::vector<size_t> >(), "set signal to catch (can be given multiple times)")
-      ("server", boost::program_options::value< std::string>(), "connect to server at this address (host:port)")
-      ("listen", boost::program_options::value< std::string >(), "listen on this port")
-      ("hostname", boost::program_options::value< std::string>(), "name of host on which this codes runs and which server can resolve")
-  ;
-
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  int status = 0;
-  status = WorkerOpts.parseHelp(vm, desc);
-  if (status) return status;
-  status = WorkerOpts.parseVerbosity(vm);
-  if (status) return status;
-  status = WorkerOpts.parseServer(vm);
-  if (status) return status;
-  status = WorkerOpts.parseListenPort(vm);
-  if (status) return status;
-  status = WorkerOpts.parseLocalhost(vm);
-  if (status) return status;
-  status = WorkerOpts.parseSignals(vm);
-  if (status) return status;
-
-  size_t exitflag = 0;
-  try
-  {
-    boost::asio::io_service io_service;
-    PoolWorker client(io_service, WorkerOpts.server, WorkerOpts.serverport, WorkerOpts.hostname, WorkerOpts.listenport);
-
-    // catch ctrl-c and shutdown worker properly
-    boost::function<void (int)> shutdownfunction = boost::bind(&PoolWorker::shutdown, boost::ref(client), _1);
-    SignalHandler signalhandler(shutdownfunction, WorkerOpts.signals);
-
-    // process io requests
-    {
-      Info info("io_service");
-      io_service.run();
-    }
-    exitflag = client.getFlag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-
-
-  return exitflag;
-}
Index: src/poolworker_main.hpp
===================================================================
--- src/poolworker_main.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,19 +1,0 @@
-/*
- * \file poolworker_main.hpp
- *
- *  Created on: Jun 04, 2012
- *      Author: heber
- */
-
-#ifndef POOLWORKER_MAIN_HPP_
-#define POOLWORKER_MAIN_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-int poolworker_main(int argc, char* argv[]);
-
-#endif /* POOLWORKER_MAIN_HPP_ */
Index: src/server_main.cpp
===================================================================
--- src/server_main.cpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,95 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2011-2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file server_main.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see server.cpp)
- *
- *  Created on: Oct 21, 2011
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <boost/program_options.hpp>
-#include <iostream>
-
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "atexit.hpp"
-#include "FragmentScheduler.hpp"
-#include "Jobs/SystemCommandJob.hpp"
-#include "ServerOptions.hpp"
-#include "SignalHandler.hpp"
-
-int server_main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  ServerOptions ServerOpts;
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("signal", boost::program_options::value< std::vector<size_t> >(), "set signal to catch (can be given multiple times)")
-      ("workerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting workers")
-      ("controllerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting controller")
-  ;
-
-  boost::program_options::variables_map vm;
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  int status = 0;
-  status = ServerOpts.parseHelp(vm, desc);
-  if (status) return status;
-  status = ServerOpts.parseVerbosity(vm);
-  if (status) return status;
-  status = ServerOpts.parseWorkerPort(vm);
-  if (status) return status;
-  status = ServerOpts.parseControllerPort(vm);
-  if (status) return status;
-  status = ServerOpts.parseSignals(vm);
-  if (status) return status;
-
-  size_t Exitflag = 0;
-  try
-  {
-    boost::asio::io_service io_service;
-    FragmentScheduler Server(io_service, ServerOpts.workerport, ServerOpts.controllerport);
-
-    // catch ctrl-c and shutdown worker properly
-    boost::function<void (int)> shutdownfunction = boost::bind(&FragmentScheduler::shutdown, boost::ref(Server), _1);
-    SignalHandler signalhandler(shutdownfunction, ServerOpts.signals);
-
-    {
-      Info info("io_service");
-      io_service.run();
-    }
-    Exitflag = Server.getExitflag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-
-  return Exitflag;
-}
Index: src/server_main.hpp
===================================================================
--- src/server_main.hpp	(revision a10cc029b85f24d56d1c8a1dd7fe5048f9d8f9df)
+++ 	(revision )
@@ -1,19 +1,0 @@
-/*
- * \file server_main.hpp
- *
- *  Created on: Jun 04, 2012
- *      Author: heber
- */
-
-#ifndef SERVER_MAIN_HPP_
-#define SERVER_MAIN_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-int server_main(int argc, char* argv[]);
-
-#endif /* SERVER_MAIN_HPP_ */
