tools: refactor ndn-autoconfig

Hub face creation and prefix registrations are moved into a new
Procedure class. Main function is simplified.

refs #4158

Change-Id: I15b660e3b8a1bde89498a1cb549a87788de46c7a
diff --git a/tools/ndn-autoconfig/guess-from-identity-name.hpp b/tools/ndn-autoconfig/guess-from-identity-name.hpp
index 315e856..9da9093 100644
--- a/tools/ndn-autoconfig/guess-from-identity-name.hpp
+++ b/tools/ndn-autoconfig/guess-from-identity-name.hpp
@@ -27,6 +27,7 @@
 #define NFD_TOOLS_NDN_AUTOCONFIG_GUESS_FROM_IDENTITY_NAME_HPP
 
 #include "stage.hpp"
+#include <ndn-cxx/security/key-chain.hpp>
 
 namespace ndn {
 namespace tools {
@@ -56,14 +57,22 @@
 class GuessFromIdentityName : public Stage
 {
 public:
-  /**
-   * @brief Create stage to guess home router based on the default identity name
-   */
-  GuessFromIdentityName(Face& face, KeyChain& keyChain,
-                        const NextStageCallback& nextStageOnFailure);
+  explicit
+  GuessFromIdentityName(KeyChain& keyChain);
 
+  const std::string&
+  getName() const override
+  {
+    static const std::string STAGE_NAME("guess from identity name");
+    return STAGE_NAME;
+  }
+
+private:
   void
-  start() override;
+  doStart() override;
+
+private:
+  KeyChain& m_keyChain;
 };
 
 } // namespace autoconfig