encoding: Fixing Block (and as a result Name) encoding bugs

As of this commit, all non-const operations on Block will call resetWire
to remove all references to the wire, so it will be recreated next time
"encode" method is called.  Also, all getter methods now have only const
versions and non-const access to the internal data structure is
prohibited.

Change-Id: If4b485dd62541d9d4d168a44490068e4deff56c1
diff --git a/src/management/ndnd-controller.cpp b/src/management/ndnd-controller.cpp
index 302699e..a897e27 100644
--- a/src/management/ndnd-controller.cpp
+++ b/src/management/ndnd-controller.cpp
@@ -175,14 +175,14 @@
   Block content = data.getContent();
   content.parse();
 
-  if (content.getAll().empty())
+  if (content.elements().empty())
     {
       if (static_cast<bool>(onFail))
         onFail("Empty response");
       return;
     }
 
-  Block::element_iterator val = content.getAll().begin();
+  Block::element_const_iterator val = content.elements_begin();
   
   switch(val->type())
     {
@@ -221,14 +221,14 @@
   Block content = data.getContent();
   content.parse();
 
-  if (content.getAll().empty())
+  if (content.elements().empty())
     {
       if (static_cast<bool>(onFail))
         onFail("Empty response");
       return;
     }
 
-  Block::element_iterator val = content.getAll().begin();
+  Block::element_const_iterator val = content.elements_begin();
   
   switch(val->type())
     {