Migrate to C++17 and refactor

Change-Id: I53407266939258990a1c3a9363c3ebe9ea113fd2
diff --git a/src/ca-module.hpp b/src/ca-module.hpp
index 88af9f1..719c3f3 100644
--- a/src/ca-module.hpp
+++ b/src/ca-module.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -28,8 +28,7 @@
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 
-namespace ndncert {
-namespace ca {
+namespace ndncert::ca {
 
 /**
  * @brief The function would be invoked whenever the certificate request status is updated.
@@ -56,7 +55,7 @@
   }
 
   const std::unique_ptr<CaStorage>&
-  getCaStorage()
+  getCaStorage() const
   {
     return m_storage;
   }
@@ -111,7 +110,6 @@
   std::list<ndn::InterestFilterHandle> m_interestFilterHandles;
 };
 
-} // namespace ca
-} // namespace ndncert
+} // namespace ndncert::ca
 
 #endif // NDNCERT_CA_MODULE_HPP