Refactor config file parsing and improve error handling

Change-Id: I8a54ba1f0d414bea70923e0f45ca354ac7e957a3
diff --git a/ndn-traffic-client.conf.sample b/ndn-traffic-client.conf.sample
index 9965d3a..1695ec7 100644
--- a/ndn-traffic-client.conf.sample
+++ b/ndn-traffic-client.conf.sample
@@ -2,20 +2,19 @@
 # THIS IS A SAMPLE CLIENT INTEREST TRAFFIC CONFIGURATION FILE
 #
 # * TO BE USED TO GENERATE INTEREST MESSAGES BASED ON A PROBABILITY
-#   PATTERN.
-# * EVERY INIVIDUAL PATTERN DESCRIPTION MUST BE SEPARATED BY ONE
+#   PATTERN
+# * EVERY INDIVIDUAL PATTERN DESCRIPTION MUST BE SEPARATED BY ONE
 #   OR MORE '#' CHARACTERS FOR THE TOOL TO DISTINGUISH THEM
-#   INDIVIDUALLY
 # * THE FOLLOWING PARAMETERS MAY BE ADDED FOR EVERY TRAFFIC PATTERN
-# * (Mandatory) NEXT TO A PARAMETER MEANS EVERY PATTERN SHOULD HAVE
-#   IT FOR BEING CONSIDERED VALID
-#   (Optional) MEANS OTHERWISE
-# * ALSO PROVIDED ARE VALID VALUES POSSIBLE FOR EACH PARAMETER
-# * PLEASE ENSURE THAT THE SUM OF TrafficPercentage FOR ALL DECLARED
-#   PATTERNS DOES NOT EXCEED 100 IN ORDER TO MAINTAIN CORRECT BEHAVIOR
-# * NNI STANDS FOR NON-NEGATIVE INTEGER
+# * 'Mandatory' ARE PARAMETERS THAT EVERY PATTERN MUST HAVE IN ORDER
+#   TO BE CONSIDERED VALID
+# * 'Boolean' ACCEPTS EITHER 0/false/no/off OR 1/true/yes/on AS VALUE
+# * 'NNI' STANDS FOR NON-NEGATIVE INTEGER
 # * RANGE OF POSSIBLE VALUES IS SPECIFIED IN []
+# * PLEASE ENSURE THAT THE SUM OF 'TrafficPercentage' FOR ALL DECLARED
+#   PATTERNS DOES NOT EXCEED 100 IN ORDER TO MAINTAIN CORRECT BEHAVIOR
 #
+
 # (Mandatory)
 #TrafficPercentage=NNI [0-100]
 #Name=NDN Name
@@ -23,10 +22,10 @@
 # (Optional)
 #NameAppendBytes=NNI [>0]
 #NameAppendSequenceNumber=NNI [>=0]
-#MustBeFresh=NNI [0-1]
+#MustBeFresh=Boolean
 #NonceDuplicationPercentage=NNI [0-100]
-#InterestLifetime=NNI [Milliseconds]
-#NextHopFaceId=NNI
+#InterestLifetime=Milliseconds [>=0]
+#NextHopFaceId=NNI [>0]
 #ExpectedContent=String
 
 ##########