encoding: reorganize Block class code

* Improve Doxygen.
* Consolidate and simplify constructors.
* Reorder class methods in cpp file to match hpp.
* Make operator== and operator!= non-member functions.
* Improve exception messages.
* Update code style.

refs #4171

Change-Id: I4cc0393f43a24a500b0efff90108ad1b42f5fa47
diff --git a/tests/unit-tests/encoding/block.t.cpp b/tests/unit-tests/encoding/block.t.cpp
index 599f37c..02b1677 100644
--- a/tests/unit-tests/encoding/block.t.cpp
+++ b/tests/unit-tests/encoding/block.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -187,9 +187,9 @@
   BOOST_CHECK(derivedBlock == Block(buffer + 2, 3));
 
   Buffer otherBuffer(buffer, sizeof(buffer));
-  BOOST_CHECK_THROW(Block(block, otherBuffer.begin(), block.end()), Block::Error);
-  BOOST_CHECK_THROW(Block(block, block.begin(), otherBuffer.end()), Block::Error);
-  BOOST_CHECK_THROW(Block(block, otherBuffer.begin(), otherBuffer.end()), Block::Error);
+  BOOST_CHECK_THROW(Block(block, otherBuffer.begin(), block.end()), std::invalid_argument);
+  BOOST_CHECK_THROW(Block(block, block.begin(), otherBuffer.end()), std::invalid_argument);
+  BOOST_CHECK_THROW(Block(block, otherBuffer.begin(), otherBuffer.end()), std::invalid_argument);
 }
 
 BOOST_AUTO_TEST_CASE(FromBlockCopyOnWriteModifyOriginal)