Use std::move in more places

Plus various code simplifications

Change-Id: I19805e4a635e4c74afaff68f9d8968475217ec6e
diff --git a/src/security/v2/trust-anchor-container.cpp b/src/security/v2/trust-anchor-container.cpp
index 80ef5cc..9137d6f 100644
--- a/src/security/v2/trust-anchor-container.cpp
+++ b/src/security/v2/trust-anchor-container.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -85,6 +85,7 @@
   auto cert = m_anchors.lower_bound(keyName);
   if (cert == m_anchors.end() || !keyName.isPrefixOf(cert->getName()))
     return nullptr;
+
   return &*cert;
 }
 
@@ -123,7 +124,7 @@
 TrustAnchorContainer::refresh()
 {
   for (auto it = m_groups.begin(); it != m_groups.end(); ++it) {
-    m_groups.modify(it, [] (shared_ptr<TrustAnchorGroup>& group) { group->refresh(); });
+    m_groups.modify(it, [] (const auto& group) { group->refresh(); });
   }
 }