diff --git a/js/ContentName.js b/js/ContentName.js
index 59a9b94..249cfbe 100644
--- a/js/ContentName.js
+++ b/js/ContentName.js
@@ -9,16 +9,16 @@
 	if( typeof _components == 'string') {
 		
 		if(LOG>3)console.log('Content Name String '+_components);
-		this.Components = ContentName.makeBlob(ContentName.createNameArray(_components));
+		this.components = ContentName.makeBlob(ContentName.createNameArray(_components));
 	}
 	else if(typeof _components === 'object' && _components instanceof Array ){
 		
 		if(LOG>4)console.log('Content Name Array '+_components);
-		this.Components = ContentName.makeBlob(_components);
+		this.components = ContentName.makeBlob(_components);
 
 	}
 	else if(_components==null){
-		this.Components =[];
+		this.components =[];
 	}
 	else{
 
@@ -31,8 +31,8 @@
 	
 	var output = "";
 	
-	for(var i=0;i<this.Components.length;i++){
-		output+= "/"+ DataUtils.toString(this.Components[i]);
+	for(var i=0;i<this.components.length;i++){
+		output+= "/"+ DataUtils.toString(this.components[i]);
 	}
 	
 	return output;
@@ -73,11 +73,11 @@
 }
 
 
-ContentName.prototype.decode = function(/*XMLDecoder*/ decoder)  {
+ContentName.prototype.from_ccnb = function(/*XMLDecoder*/ decoder)  {
 		decoder.readStartElement(this.getElementLabel());
 
 		
-		this.Components = new Array(); //new ArrayList<byte []>();
+		this.components = new Array(); //new ArrayList<byte []>();
 
 		while (decoder.peekStartElement(CCNProtocolDTags.Component)) {
 			this.add(decoder.readBinaryElement(CCNProtocolDTags.Component));
@@ -86,15 +86,15 @@
 		decoder.readEndElement();
 };
 
-ContentName.prototype.encode = function(/*XMLEncoder*/ encoder)  {
+ContentName.prototype.to_ccnb = function(/*XMLEncoder*/ encoder)  {
 		
-		if( this.Components ==null ) 
+		if( this.components ==null ) 
 			throw new Exception("CANNOT ENCODE EMPTY CONTENT NAME");
 
 		encoder.writeStartElement(this.getElementLabel());
-		var count = this.Components.length;
+		var count = this.components.length;
 		for (var i=0; i < count; i++) {
-			encoder.writeElement(CCNProtocolDTags.Component, this.Components[i]);
+			encoder.writeElement(CCNProtocolDTags.Component, this.components[i]);
 		}
 		encoder.writeEndElement();
 };
@@ -104,6 +104,6 @@
 };
 
 ContentName.prototype.add = function(param){
-	return this.Components.push(param);
+	return this.components.push(param);
 };
 
diff --git a/js/ContentObject.js b/js/ContentObject.js
index 5ac4d28..eb5db79 100644
--- a/js/ContentObject.js
+++ b/js/ContentObject.js
@@ -12,9 +12,9 @@
 		//TODO Check the class of _name
 		this.name = _name;
 	}
-	this.SignedInfo = _signedInfo;
+	this.signedInfo = _signedInfo;
 	this.content=_content;
-	this.Signature = _signature;
+	this.signature = _signature;
 
 	
 	this.startSIG = null;
@@ -29,7 +29,7 @@
 ContentObject.prototype.sign = function(){
 
 	var n1 = this.encodeObject(this.name);
-	var n2 = this.encodeObject(this.SignedInfo);
+	var n2 = this.encodeObject(this.signedInfo);
 	var n3 = this.encodeContent();
 	
 	var n = n1.concat(n2,n3);
@@ -58,7 +58,7 @@
 	
 	if(LOG>2)console.log(  DataUtils.toNumbers(hSig.trim()));
 
-	this.Signature.Signature = DataUtils.toNumbers(hSig.trim());
+	this.signature.signature = DataUtils.toNumbers(hSig.trim());
 	
 
 };
@@ -66,7 +66,7 @@
 ContentObject.prototype.encodeObject = function encodeObject(obj){
 	var enc = new BinaryXMLEncoder();
  
-	obj.encode(enc);
+	obj.to_ccnb(enc);
 	
 	var num = enc.getReducedOstream();
 
@@ -102,8 +102,8 @@
 
 
 		if( decoder.peekStartElement(CCNProtocolDTags.Signature) ){
-			this.Signature = new Signature();
-			this.Signature.decode(decoder);
+			this.signature = new Signature();
+			this.signature.from_ccnb(decoder);
 		}
 		
 		//this.endSIG = decoder.offset;
@@ -111,14 +111,14 @@
 		this.startSIG = decoder.offset;
 
 		this.name = new ContentName();
-		this.name.decode(decoder);
+		this.name.from_ccnb(decoder);
 		
 		//this.startSignedInfo = decoder.offset;
 	
 		
 		if( decoder.peekStartElement(CCNProtocolDTags.SignedInfo) ){
-			this.SignedInfo = new SignedInfo();
-			this.SignedInfo.decode(decoder);
+			this.signedInfo = new SignedInfo();
+			this.signedInfo.from_ccnb(decoder);
 		}
 		
 		this.content = decoder.readBinaryElement(CCNProtocolDTags.Content);
@@ -143,19 +143,19 @@
 	
 
 
-	if(null!=this.Signature) this.Signature.encode(encoder);
+	if(null!=this.signature) this.signature.to_ccnb(encoder);
 	
 	
 	this.startSIG = encoder.offset;
 	
 
-	if(null!=this.name) this.name.encode(encoder);
+	if(null!=this.name) this.name.to_ccnb(encoder);
 	
 	//this.endSIG = encoder.offset;
 	//this.startSignedInfo = encoder.offset;
 	
 	
-	if(null!=this.SignedInfo) this.SignedInfo.encode(encoder);
+	if(null!=this.signedInfo) this.signedInfo.to_ccnb(encoder);
 
 	encoder.writeElement(CCNProtocolDTags.Content, this.content);
 
diff --git a/js/Exclude.js b/js/Exclude.js
index 50f8ea7..1ee9112 100644
--- a/js/Exclude.js
+++ b/js/Exclude.js
@@ -3,16 +3,16 @@
  * This class represents Exclude objects
  */
 
-var Exclude = function Exclude(_Values){ 
+var Exclude = function Exclude(_values){ 
 	
 	this.OPTIMUM_FILTER_SIZE = 100;
 	
 
-	this.Values = _Values; //array of elements
+	this.values = _values; //array of elements
 	
 }
 
-Exclude.prototype.decode = function(/*XMLDecoder*/ decoder) {
+Exclude.prototype.from_ccnb = function(/*XMLDecoder*/ decoder) {
 
 
 		
@@ -35,7 +35,7 @@
 
 };
 
-Exclude.prototype.encode=function(/*XMLEncoder*/ encoder)  {
+Exclude.prototype.to_ccnb=function(/*XMLEncoder*/ encoder)  {
 		if (!validate()) {
 			throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
 		}
diff --git a/js/ExcludeAny.js b/js/ExcludeAny.js
index 25a1a23..7986cba 100644
--- a/js/ExcludeAny.js
+++ b/js/ExcludeAny.js
@@ -7,13 +7,13 @@
 
 };
 
-ExcludeAny.prototype.decode = function(decoder) {
+ExcludeAny.prototype.from_ccnb = function(decoder) {
 		decoder.readStartElement(this.getElementLabel());
 		decoder.readEndElement();
 };
 
 
-ExcludeAny.prototype.encode = function( encoder) {
+ExcludeAny.prototype.to_ccnb = function( encoder) {
 		encoder.writeStartElement(this.getElementLabel());
 		encoder.writeEndElement();
 };
diff --git a/js/ExcludeComponent.js b/js/ExcludeComponent.js
index ed2bbeb..d723d93 100644
--- a/js/ExcludeComponent.js
+++ b/js/ExcludeComponent.js
@@ -3,19 +3,19 @@
  * This class represents Exclude Component OBjects
  */
 
-var ExcludeComponent = function ExcludeComponent(_Body) {
+var ExcludeComponent = function ExcludeComponent(_body) {
 
 	//TODO Check BODY is an Array of componenets.
 	
-	this.Body = _Body
+	this.body = _body
 };
 
-ExcludeComponent.prototype.decode = function( decoder)  {
-		body = decoder.readBinaryElement(this.getElementLabel());
+ExcludeComponent.prototype.from_ccnb = function( decoder)  {
+		this.body = decoder.readBinaryElement(this.getElementLabel());
 };
 
-ExcludeComponent.prototype.encode = function(encoder) {
-		encoder.writeElement(this.getElementLabel(), body);
+ExcludeComponent.prototype.to_ccnb = function(encoder) {
+		encoder.writeElement(this.getElementLabel(), this.body);
 };
 
 ExcludeComponent.prototype.getElementLabel = function() { return CCNProtocolDTags.Component; };
diff --git a/js/FaceInstance.js b/js/FaceInstance.js
index 5cac6bc..78ac5de 100644
--- a/js/FaceInstance.js
+++ b/js/FaceInstance.js
@@ -6,36 +6,36 @@
 var NetworkProtocol = { TCP:6, UDP:17};
 
 var FaceInstance  = function FaceInstance(
-	    _Action,
-		_PublisherPublicKeyDigest,
-		_FaceID,
-		_IPProto,
-		_Host,
-		_Port,
-		_MulticastInterface,
-		_MulticastTTL,
-		_FreshnessSeconds){
+	    _action,
+		_publisherPublicKeyDigest,
+		_faceID,
+		_ipProto,
+		_host,
+		_port,
+		_multicastInterface,
+		_multicastTTL,
+		_freshnessSeconds){
 	
 
-	this.Action = _Action;
-	this.PublisherPublicKeyDigest = _PublisherPublicKeyDigest;
-	this.FaceID = _FaceID;
-	this.IPProto = _IPProto;
-	this.Host = _Host;
-	this.Port = _Port;
-	this.MulticastInterface =_MulticastInterface;
-	this.MulticastTTL =_MulticastTTL;
-	this.FreshnessSeconds = _FreshnessSeconds;
+	this.action = _action;
+	this.publisherPublicKeyDigest = _publisherPublicKeyDigest;
+	this.faceID = _faceID;
+	this.ipProto = _ipProto;
+	this.host = _host;
+	this.Port = _port;
+	this.multicastInterface =_multicastInterface;
+	this.multicastTTL =_multicastTTL;
+	this.freshnessSeconds = _freshnessSeconds;
 	
-	//Action           ::= ("newface" | "destroyface" | "queryface")
-	//PublisherPublicKeyDigest ::= SHA-256 digest
-	//FaceID           ::= nonNegativeInteger
-	//IPProto          ::= nonNegativeInteger [IANA protocol number, 6=TCP, 17=UDP]
+	//action           ::= ("newface" | "destroyface" | "queryface")
+	//publisherPublicKeyDigest ::= SHA-256 digest
+	//faceID           ::= nonNegativeInteger
+	//ipProto          ::= nonNegativeInteger [IANA protocol number, 6=TCP, 17=UDP]
 	//Host             ::= textual representation of numeric IPv4 or IPv6 address
 	//Port             ::= nonNegativeInteger [1..65535]
 	//MulticastInterface ::= textual representation of numeric IPv4 or IPv6 address
 	//MulticastTTL     ::= nonNegativeInteger [1..255]
-	//FreshnessSeconds ::= nonNegativeInteger
+	//freshnessSeconds ::= nonNegativeInteger
 
 };
 
@@ -43,25 +43,25 @@
  * Used by NetworkObject to decode the object from a network stream.
  * @see org.ccnx.ccn.impl.encoding.XMLEncodable
  */
-FaceInstance.prototype.decode = function(//XMLDecoder 
+FaceInstance.prototype.from_ccnb = function(//XMLDecoder 
 	decoder) {
 
 	decoder.readStartElement(this.getElementLabel());
 	
 	if (decoder.peekStartElement(CCNProtocolDTags.Action)) {
 		
-		this.Action = decoder.readUTF8Element(CCNProtocolDTags.Action);
+		this.action = decoder.readUTF8Element(CCNProtocolDTags.Action);
 		
 	}
 	if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
 		
-		this.PublisherPublicKeyDigest = new PublisherPublicKeyDigest();
-		this.PublisherPublicKeyDigest.decode(decoder);
+		this.publisherPublicKeyDigest = new PublisherPublicKeyDigest();
+		this.publisherPublicKeyDigest.from_ccnb(decoder);
 		
 	}
 	if (decoder.peekStartElement(CCNProtocolDTags.FaceID)) {
 		
-		this.FaceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
+		this.faceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
 		
 	}
 	if (decoder.peekStartElement(CCNProtocolDTags.IPProto)) {
@@ -69,15 +69,15 @@
 		//int
 		var pI = decoder.readIntegerElement(CCNProtocolDTags.IPProto);
 		
-		this.IPProto = null;
+		this.ipProto = null;
 		
 		if (NetworkProtocol.TCP == pI) {
 			
-			this.IPProto = NetworkProtocol.TCP;
+			this.ipProto = NetworkProtocol.TCP;
 			
 		} else if (NetworkProtocol.UDP == pI) {
 			
-			this.IPProto = NetworkProtocol.UDP;
+			this.ipProto = NetworkProtocol.UDP;
 			
 		} else {
 			
@@ -89,7 +89,7 @@
 	
 	if (decoder.peekStartElement(CCNProtocolDTags.Host)) {
 		
-		this.Host = decoder.readUTF8Element(CCNProtocolDTags.Host);
+		this.host = decoder.readUTF8Element(CCNProtocolDTags.Host);
 		
 	}
 	
@@ -98,15 +98,15 @@
 	}
 	
 	if (decoder.peekStartElement(CCNProtocolDTags.MulticastInterface)) {
-		this.MulticastInterface = decoder.readUTF8Element(CCNProtocolDTags.MulticastInterface); 
+		this.multicastInterface = decoder.readUTF8Element(CCNProtocolDTags.MulticastInterface); 
 	}
 	
 	if (decoder.peekStartElement(CCNProtocolDTags.MulticastTTL)) {
-		this.MulticastTTL = decoder.readIntegerElement(CCNProtocolDTags.MulticastTTL); 
+		this.multicastTTL = decoder.readIntegerElement(CCNProtocolDTags.MulticastTTL); 
 	}
 	
 	if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
-		this.FreshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds); 
+		this.freshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds); 
 	}
 	decoder.readEndElement();
 }
@@ -115,7 +115,7 @@
  * Used by NetworkObject to encode the object to a network stream.
  * @see org.ccnx.ccn.impl.encoding.XMLEncodable
  */
-FaceInstance.prototype.encode = function(//XMLEncoder
+FaceInstance.prototype.to_ccnb = function(//XMLEncoder
 	encoder){
 
 	//if (!this.validate()) {
@@ -124,33 +124,33 @@
 	//}
 	encoder.writeStartElement(this.getElementLabel());
 	
-	if (null != this.Action && this.Action.length != 0)
-		encoder.writeElement(CCNProtocolDTags.Action, this.Action);	
+	if (null != this.action && this.action.length != 0)
+		encoder.writeElement(CCNProtocolDTags.Action, this.action);	
 	
-	if (null != this.PublisherPublicKeyDigest) {
-		this.PublisherPublicKeyDigest.encode(encoder);
+	if (null != this.publisherPublicKeyDigest) {
+		this.publisherPublicKeyDigest.to_ccnb(encoder);
 	}
-	if (null != this.FaceID) {
-		encoder.writeElement(CCNProtocolDTags.FaceID, this.FaceID);
+	if (null != this.faceID) {
+		encoder.writeElement(CCNProtocolDTags.FaceID, this.faceID);
 	}
-	if (null != this.IPProto) {
+	if (null != this.ipProto) {
 		//encoder.writeElement(CCNProtocolDTags.IPProto, this.IpProto.value());
-		encoder.writeElement(CCNProtocolDTags.IPProto, this.IPProto);
+		encoder.writeElement(CCNProtocolDTags.IPProto, this.ipProto);
 	}
-	if (null != this.Host && this.Host.length != 0) {
-		encoder.writeElement(CCNProtocolDTags.Host, this.Host);	
+	if (null != this.host && this.host.length != 0) {
+		encoder.writeElement(CCNProtocolDTags.Host, this.host);	
 	}
 	if (null != this.Port) {
 		encoder.writeElement(CCNProtocolDTags.Port, this.Port);
 	}
-	if (null != this.MulticastInterface && this.MulticastInterface.length != 0) {
-		encoder.writeElement(CCNProtocolDTags.MulticastInterface, this.MulticastInterface);
+	if (null != this.multicastInterface && this.multicastInterface.length != 0) {
+		encoder.writeElement(CCNProtocolDTags.MulticastInterface, this.multicastInterface);
 	}
-	if (null !=  this.MulticastTTL) {
-		encoder.writeElement(CCNProtocolDTags.MulticastTTL, this.MulticastTTL);
+	if (null !=  this.multicastTTL) {
+		encoder.writeElement(CCNProtocolDTags.MulticastTTL, this.multicastTTL);
 	}
-	if (null != this.FreshnessSeconds) {
-		encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.FreshnessSeconds);
+	if (null != this.freshnessSeconds) {
+		encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.freshnessSeconds);
 	}
 	encoder.writeEndElement();   			
 }
diff --git a/js/ForwardingEntry.js b/js/ForwardingEntry.js
index 60fe750..4f04478 100644
--- a/js/ForwardingEntry.js
+++ b/js/ForwardingEntry.js
@@ -20,45 +20,45 @@
 		
 	
 		//String
-	this.Action = _action;
+	this.action = _action;
 		//ContentName\
-	this.PrefixName = _prefixName;
+	this.prefixName = _prefixName;
 		//PublisherPublicKeyDigest 
-	this.CCNID = _ccndId;
+	this.ccndID = _ccndId;
 		//Integer		
-	this.FaceID = _faceID;
+	this.faceID = _faceID;
 		//Integer		
-	this.Flags = _flags;
+	this.flags = _flags;
 		//Integer 		
-	this.Lifetime = _lifetime;  // in seconds
+	this.lifetime = _lifetime;  // in seconds
 
 };
 
-ForwardingEntry.prototype.decode =function(
+ForwardingEntry.prototype.from_ccnb =function(
 	//XMLDecoder 
 	decoder) 
 	//throws ContentDecodingException
 	{
 			decoder.readStartElement(this.getElementLabel());
 			if (decoder.peekStartElement(CCNProtocolDTags.Action)) {
-				this.Action = decoder.readUTF8Element(CCNProtocolDTags.Action); 
+				this.action = decoder.readUTF8Element(CCNProtocolDTags.Action); 
 			}
 			if (decoder.peekStartElement(CCNProtocolDTags.Name)) {
-				this.PrefixName = new ContentName();
-				this.PrefixName.decode(decoder) ;
+				this.prefixName = new ContentName();
+				this.prefixName.from_ccnb(decoder) ;
 			}
 			if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
 				this.CcndId = new PublisherPublicKeyDigest();
-				this.CcndId.decode(decoder);
+				this.CcndId.from_ccnb(decoder);
 			}
 			if (decoder.peekStartElement(CCNProtocolDTags.FaceID)) {
-				this.FaceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID); 
+				this.faceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID); 
 			}
 			if (decoder.peekStartElement(CCNProtocolDTags.ForwardingFlags)) {
-				this.Flags = decoder.readIntegerElement(CCNProtocolDTags.ForwardingFlags); 
+				this.flags = decoder.readIntegerElement(CCNProtocolDTags.ForwardingFlags); 
 			}
 			if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
-				this.Lifetime = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds); 
+				this.lifetime = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds); 
 			}
 			decoder.readEndElement();
 		};
@@ -67,7 +67,7 @@
 		 * Used by NetworkObject to encode the object to a network stream.
 		 * @see org.ccnx.ccn.impl.encoding.XMLEncodable
 		 */
-ForwardingEntry.prototype.encode =function(
+ForwardingEntry.prototype.to_ccnb =function(
 	//XMLEncoder 
 encoder) 
 {
@@ -77,22 +77,22 @@
 				//throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
 			//}
 			encoder.writeStartElement(this.getElementLabel());
-			if (null != this.Action && this.Action.length != 0)
-				encoder.writeElement(CCNProtocolDTags.Action, this.Action);	
-			if (null != this.PrefixName) {
-				this.PrefixName.encode(encoder);
+			if (null != this.action && this.action.length != 0)
+				encoder.writeElement(CCNProtocolDTags.Action, this.action);	
+			if (null != this.prefixName) {
+				this.prefixName.to_ccnb(encoder);
 			}
 			if (null != this.CcndId) {
-				this.CcndId.encode(encoder);
+				this.CcndId.to_ccnb(encoder);
 			}
-			if (null != this.FaceID) {
-				encoder.writeElement(CCNProtocolDTags.FaceID, this.FaceID);
+			if (null != this.faceID) {
+				encoder.writeElement(CCNProtocolDTags.FaceID, this.faceID);
 			}
-			if (null != this.Flags) {
-				encoder.writeElement(CCNProtocolDTags.ForwardingFlags, this.Flags);
+			if (null != this.flags) {
+				encoder.writeElement(CCNProtocolDTags.ForwardingFlags, this.flags);
 			}
-			if (null != this.Lifetime) {
-				encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.Lifetime);
+			if (null != this.lifetime) {
+				encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.lifetime);
 			}
 			encoder.writeEndElement();   			
 		};
diff --git a/js/Interest.js b/js/Interest.js
index 46303b1..15fb05a 100644
--- a/js/Interest.js
+++ b/js/Interest.js
@@ -37,7 +37,7 @@
 		decoder.readStartElement(CCNProtocolDTags.Interest);
 
 		this.name = new ContentName();
-		this.name.decode(decoder);
+		this.name.from_ccnb(decoder);
 
 		if (decoder.peekStartElement(CCNProtocolDTags.MinSuffixComponents)) {
 			this.minSuffixComponents = decoder.readIntegerElement(CCNProtocolDTags.MinSuffixComponents);
@@ -48,13 +48,13 @@
 		}
 			
 		if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
-			this.publisherPublicKeyDigest = new PublisherPublicKeyDigest();
-			this.publisherPublicKeyDigest.decode(decoder);
+			this.publisherPublicKeyDigest = new publisherPublicKeyDigest();
+			this.publisherPublicKeyDigest.from_ccnb(decoder);
 		}
 
 		if (decoder.peekStartElement(CCNProtocolDTags.Exclude)) {
 			this.exclude = new Exclude();
-			this.exclude.decode(decoder);
+			this.exclude.from_ccnb(decoder);
 		}
 		
 		if (decoder.peekStartElement(CCNProtocolDTags.ChildSelector)) {
@@ -86,7 +86,7 @@
 		
 		encoder.writeStartElement(CCNProtocolDTags.Interest);
 		
-		this.name.encode(encoder);
+		this.name.to_ccnb(encoder);
 	
 		if (null != this.minSuffixComponents) 
 			encoder.writeElement(CCNProtocolDTags.MinSuffixComponents, this.minSuffixComponents);	
@@ -95,10 +95,10 @@
 			encoder.writeElement(CCNProtocolDTags.MaxSuffixComponents, this.maxSuffixComponents);
 
 		if (null != this.publisherPublicKeyDigest)
-			this.publisherPublicKeyDigest.encode(encoder);
+			this.publisherPublicKeyDigest.to_ccnb(encoder);
 		
 		if (null != this.exclude)
-			this.exclude.encode(encoder);
+			this.exclude.to_ccnb(encoder);
 		
 		if (null != this.childSelector) 
 			encoder.writeElement(CCNProtocolDTags.ChildSelector, this.childSelector);
@@ -118,8 +118,8 @@
 };
 
 Interest.prototype.matches_name = function(/*ContentName*/ name){
-	var i_name = this.name.Components;
-	var o_name = name.Components;
+	var i_name = this.name.components;
+	var o_name = name.components;
 
 	// The intrest name is longer than the name we are checking it against.
 	if (i_name.length > o_name.length)
diff --git a/js/KeyLocator.js b/js/KeyLocator.js
index 9ada28b..96df104 100644
--- a/js/KeyLocator.js
+++ b/js/KeyLocator.js
@@ -9,24 +9,24 @@
 	  CERTIFICATE:3
 };
 
-var KeyLocator = function KeyLocator(_Input,_Type){ 
+var KeyLocator = function KeyLocator(_input,_type){ 
 
-    this.Type=_Type;
+    this.type=_type;
     
-    if (_Type==KeyLocatorType.NAME){
-    	this.KeyName = _Input;
+    if (_type==KeyLocatorType.NAME){
+    	this.keyName = _input;
     }
-    else if(_Type==KeyLocatorType.KEY){
+    else if(_type==KeyLocatorType.KEY){
     	console.log('SET KEY');
-    	this.PublicKey = _Input;
+    	this.publicKey = _input;
     }
-    else if(_Type==KeyLocatorType.CERTIFICATE){
-    	this.Certificate = _Input;
+    else if(_type==KeyLocatorType.CERTIFICATE){
+    	this.certificate = _input;
     }
 
 };
 
-KeyLocator.prototype.decode = function(decoder) {
+KeyLocator.prototype.from_ccnb = function(decoder) {
 
 		decoder.readStartElement(this.getElementLabel());
 
@@ -37,19 +37,19 @@
 				
 				//TODO FIX THIS, This should create a Key Object instead of keeping bytes
 
-				this.PublicKey =   encodedKey;//CryptoUtil.getPublicKey(encodedKey);
-				this.Type = 2;
+				this.publicKey =   encodedKey;//CryptoUtil.getPublicKey(encodedKey);
+				this.type = 2;
 				
 
-				if(LOG>4) console.log('PUBLIC KEY FOUND: '+ this.PublicKey);
-				//this.PublicKey = encodedKey;
+				if(LOG>4) console.log('PUBLIC KEY FOUND: '+ this.publicKey);
+				//this.publicKey = encodedKey;
 				
 				
 			} catch (e) {
 				throw new Exception("Cannot parse key: ", e);
 			} 
 
-			if (null == this.PublicKey) {
+			if (null == this.publicKey) {
 				throw new Exception("Cannot parse key: ");
 			}
 
@@ -62,34 +62,34 @@
 				 */
 				
 				//CertificateFactory factory = CertificateFactory.getInstance("X.509");
-				//this.Certificate = (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encodedCert));
+				//this.certificate = (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encodedCert));
 				
 
-				this.Certificate = encodedCert;
-				this.Type = 3;
+				this.certificate = encodedCert;
+				this.type = 3;
 
-				if(LOG>4) console.log('CERTIFICATE FOUND: '+ this.Certificate);
+				if(LOG>4) console.log('CERTIFICATE FOUND: '+ this.certificate);
 				
 			} catch ( e) {
 				throw new Exception("Cannot decode certificate: " +  e);
 			}
-			if (null == this.Certificate) {
+			if (null == this.certificate) {
 				throw new Exception("Cannot parse certificate! ");
 			}
 		} else  {
-			this.Type = 1;
+			this.type = 1;
 
 
-			this.KeyName = new KeyName();
-			this.KeyName.decode(decoder);
+			this.keyName = new KeyName();
+			this.keyName.from_ccnb(decoder);
 		}
 		decoder.readEndElement();
 	}
 	
 
-	KeyLocator.prototype.encode = function( encoder) {
+	KeyLocator.prototype.to_ccnb = function( encoder) {
 		
-		if(LOG>2) console.log('type is is ' + this.Type);
+		if(LOG>2) console.log('type is is ' + this.type);
 		//TODO Check if Name is missing
 		if (!this.validate()) {
 			throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
@@ -99,21 +99,21 @@
 		//TODO FIX THIS TOO
 		encoder.writeStartElement(this.getElementLabel());
 		
-		if (this.Type == KeyLocatorType.KEY) {
-			if(LOG>5)console.log('About to encode a public key' +this.PublicKey);
-			encoder.writeElement(CCNProtocolDTags.Key, this.PublicKey);
+		if (this.type == KeyLocatorType.KEY) {
+			if(LOG>5)console.log('About to encode a public key' +this.publicKey);
+			encoder.writeElement(CCNProtocolDTags.Key, this.publicKey);
 			
-		} else if (this.Type == KeyLocatorType.CERTIFICATE) {
+		} else if (this.type == KeyLocatorType.CERTIFICATE) {
 			
 			try {
-				encoder.writeElement(CCNProtocolDTags.Certificate, this.Certificate);
+				encoder.writeElement(CCNProtocolDTags.Certificate, this.certificate);
 			} catch ( e) {
 				throw new Exception("CertificateEncodingException attempting to write key locator: " + e);
 			}
 			
-		} else if (this.Type == KeyLocatorType.NAME) {
+		} else if (this.type == KeyLocatorType.NAME) {
 			
-			this.KeyName.encode(encoder);
+			this.keyName.to_ccnb(encoder);
 		}
 		encoder.writeEndElement();
 		
@@ -124,6 +124,6 @@
 };
 
 KeyLocator.prototype.validate = function() {
-	return (  (null != this.KeyName) || (null != this.PublicKey) || (null != this.Certificate)   );
+	return (  (null != this.keyName) || (null != this.publicKey) || (null != this.certificate)   );
 };
 	
\ No newline at end of file
diff --git a/js/KeyName.js b/js/KeyName.js
index c156af1..e958c3f 100644
--- a/js/KeyName.js
+++ b/js/KeyName.js
@@ -6,40 +6,40 @@
 var KeyName = function KeyName() {
 	
 
-	this.ContentName = this.ContentName;//ContentName
-	this.PublisherID =this.PublisherID;//PublisherID
+	this.contentName = this.contentName;//contentName
+	this.publisherID =this.publisherID;//publisherID
 
 };
 
 
-KeyName.prototype.decode=function( decoder){
+KeyName.prototype.from_ccnb=function( decoder){
 	
 
 	decoder.readStartElement(this.getElementLabel());
 
-	this.ContentName = new ContentName();
-	this.ContentName.decode(decoder);
+	this.contentName = new ContentName();
+	this.contentName.from_ccnb(decoder);
 	
 	if(LOG>4) console.log('KEY NAME FOUND: ');
 	
 	if ( PublisherID.peek(decoder) ) {
-		this.PublisherID = new PublisherID();
-		this.PublisherID.decode(decoder);
+		this.publisherID = new PublisherID();
+		this.publisherID.from_ccnb(decoder);
 	}
 	
 	decoder.readEndElement();
 };
 
-KeyName.prototype.encode = function( encoder) {
+KeyName.prototype.to_ccnb = function( encoder) {
 	if (!this.validate()) {
 		throw new Exception("Cannot encode : field values missing.");
 	}
 	
 	encoder.writeStartElement(this.getElementLabel());
 	
-	this.ContentName.encode(encoder);
-	if (null != this.PublisherID)
-		this.PublisherID.encode(encoder);
+	this.contentName.to_ccnb(encoder);
+	if (null != this.publisherID)
+		this.publisherID.to_ccnb(encoder);
 
 	encoder.writeEndElement();   		
 };
@@ -49,5 +49,5 @@
 KeyName.prototype.validate = function() {
 		// DKS -- do we do recursive validation?
 		// null signedInfo ok
-		return (null != this.ContentName);
+		return (null != this.contentName);
 };
diff --git a/js/PublisherID.js b/js/PublisherID.js
index 64955f3..3558d24 100644
--- a/js/PublisherID.js
+++ b/js/PublisherID.js
@@ -34,16 +34,16 @@
 	//TODO, implement publisherID creation and key creation
 
     //TODO implement generatePublicKeyDigest
-    this.PublisherID =null;//= generatePublicKeyDigest(key);//ByteArray
+    this.publisherID =null;//= generatePublicKeyDigest(key);//ByteArray
     
     //TODO implement generate key
     //CryptoUtil.generateKeyID(PUBLISHER_ID_DIGEST_ALGORITHM, key);
-    this.PublisherType = null;//isIssuer ? PublisherType.ISSUER_KEY : PublisherType.KEY;//publisher Type
+    this.publisherType = null;//isIssuer ? PublisherType.ISSUER_KEY : PublisherType.KEY;//publisher Type
     
 };
 
 
-PublisherID.prototype.decode = function(decoder) {
+PublisherID.prototype.from_ccnb = function(decoder) {
 		
 		// We have a choice here of one of 4 binary element types.
 		var nextTag = decoder.peekStartElementAsLong();
@@ -52,23 +52,23 @@
 			throw new Exception("Cannot parse publisher ID.");
 		} 
 		
-		this.PublisherType = new PublisherType(nextTag); 
+		this.publisherType = new PublisherType(nextTag); 
 		
 		if (!isTypeTagVal(nextTag)) {
 			throw new Exception("Invalid publisher ID, got unexpected type: " + nextTag);
 		}
-		this.PublisherID = decoder.readBinaryElement(nextTag);
-		if (null == this.PublisherID) {
+		this.publisherID = decoder.readBinaryElement(nextTag);
+		if (null == this.publisherID) {
 			throw new ContentDecodingException("Cannot parse publisher ID of type : " + nextTag + ".");
 		}
 };
 
-PublisherID.prototype.encode = function(encoder) {
+PublisherID.prototype.to_ccnb = function(encoder) {
 	if (!this.validate()) {
 		throw new Exception("Cannot encode " + this.getClass().getName() + ": field values missing.");
 	}
 
-	encoder.writeElement(this.getElementLabel(), this.PublisherID);
+	encoder.writeElement(this.getElementLabel(), this.publisherID);
 };
 	
 PublisherID.peek = function(/* XMLDecoder */ decoder) {
@@ -84,7 +84,7 @@
 	};
 
 PublisherID.prototype.getElementLabel = function() { 
-	return this.PublisherType.Tag;
+	return this.publisherType.Tag;
 };
 
 PublisherID.prototype.validate = function(){
diff --git a/js/PublisherPublicKeyDigest.js b/js/PublisherPublicKeyDigest.js
index a5b400d..50f856c 100644
--- a/js/PublisherPublicKeyDigest.js
+++ b/js/PublisherPublicKeyDigest.js
@@ -8,44 +8,44 @@
 	 this.PUBLISHER_ID_LEN = 512/8;
  	 
 
-	 this.PublisherPublicKeyDigest = _pkd;
- 	 //if( typeof _pkd == "object") this.PublisherPublicKeyDigest = _pkd; // Byte Array
+	 this.publisherPublicKeyDigest = _pkd;
+ 	 //if( typeof _pkd == "object") this.publisherPublicKeyDigest = _pkd; // Byte Array
  	 //else if( typeof _pkd == "PublicKey") ;//TODO...
     
 };
 
-PublisherPublicKeyDigest.prototype.decode = function( decoder) {		
+PublisherPublicKeyDigest.prototype.from_ccnb = function( decoder) {		
 
-		this.PublisherPublicKeyDigest = decoder.readBinaryElement(this.getElementLabel());
+		this.publisherPublicKeyDigest = decoder.readBinaryElement(this.getElementLabel());
 		
-		if(LOG>4)console.log('Publisher public key digest is ' + this.PublisherPublicKeyDigest);
+		if(LOG>4)console.log('Publisher public key digest is ' + this.publisherPublicKeyDigest);
 
-		if (null == this.PublisherPublicKeyDigest) {
+		if (null == this.publisherPublicKeyDigest) {
 			throw new Exception("Cannot parse publisher key digest.");
 		}
 		
 		//TODO check if the length of the PublisherPublicKeyDigest is correct ( Security reason)
 
-		if (this.PublisherPublicKeyDigest.length != this.PUBLISHER_ID_LEN) {
+		if (this.publisherPublicKeyDigest.length != this.PUBLISHER_ID_LEN) {
 			
-			console.log('LENGTH OF PUBLISHER ID IS WRONG! Expected ' + this.PUBLISHER_ID_LEN + ", got " + this.PublisherPublicKeyDigest.length);
+			console.log('LENGTH OF PUBLISHER ID IS WRONG! Expected ' + this.PUBLISHER_ID_LEN + ", got " + this.publisherPublicKeyDigest.length);
 			
-			//this.PublisherPublicKeyDigest = new PublisherPublicKeyDigest(this.PublisherPublicKeyDigest).PublisherKeyDigest;
+			//this.publisherPublicKeyDigest = new PublisherPublicKeyDigest(this.PublisherPublicKeyDigest).PublisherKeyDigest;
 		
 		}
 	};
 
-PublisherPublicKeyDigest.prototype.encode= function( encoder) {
+PublisherPublicKeyDigest.prototype.to_ccnb= function( encoder) {
 		//TODO Check that the ByteArray for the key is present
 		if (!this.validate()) {
 			throw new Exception("Cannot encode : field values missing.");
 		}
-		if(LOG>3) console.log('PUBLISHER KEY DIGEST IS'+this.PublisherPublicKeyDigest);
-		encoder.writeElement(this.getElementLabel(), this.PublisherPublicKeyDigest);
+		if(LOG>3) console.log('PUBLISHER KEY DIGEST IS'+this.publisherPublicKeyDigest);
+		encoder.writeElement(this.getElementLabel(), this.publisherPublicKeyDigest);
 };
 	
 PublisherPublicKeyDigest.prototype.getElementLabel = function() { return CCNProtocolDTags.PublisherPublicKeyDigest; };
 
 PublisherPublicKeyDigest.prototype.validate =function() {
-		return (null != this.PublisherPublicKeyDigest);
+		return (null != this.publisherPublicKeyDigest);
 };
diff --git a/js/Signature.js b/js/Signature.js
index 7eef1d1..9672b3f 100644
--- a/js/Signature.js
+++ b/js/Signature.js
@@ -4,17 +4,17 @@
  */
 
 
-var Signature = function Signature(_Witness,_Signature,_DigestAlgorithm) {
+var Signature = function Signature(_witness,_signature,_digestAlgorithm) {
 	
-    this.Witness = _Witness;//byte [] _witness;
-	this.Signature = _Signature;//byte [] _signature;
-	this.DigestAlgorithm = _DigestAlgorithm//String _digestAlgorithm;
+    this.Witness = _witness;//byte [] _witness;
+	this.signature = _signature;//byte [] _signature;
+	this.digestAlgorithm = _digestAlgorithm//String _digestAlgorithm;
 };
 
 var generateSignature = function(contentName,content,signedinfo){
 	
 	var enc = new BinaryXMLEncoder();
-	contentName.encode(enc);
+	contentName.to_ccnb(enc);
 	var hex1 = toHex(enc.getReducedOstream());
 
 	var enc = new BinaryXMLEncoder();
@@ -22,7 +22,7 @@
 	var hex2 = toHex(enc.getReducedOstream());
 
 	var enc = new BinaryXMLEncoder();
-	signedinfo.encode(enc);
+	signedinfo.to_ccnb(enc);
 	var hex3 = toHex(enc.getReducedOstream());
 
 	var hex = hex1+hex2+hex3;
@@ -31,7 +31,7 @@
 
 };
 
-Signature.prototype.decode =function( decoder) {
+Signature.prototype.from_ccnb =function( decoder) {
 		decoder.readStartElement(this.getElementLabel());
 		
 		if(LOG>4)console.log('STARTED DECODING SIGNATURE ');
@@ -39,7 +39,7 @@
 		if (decoder.peekStartElement(CCNProtocolDTags.DigestAlgorithm)) {
 			
 			if(LOG>4)console.log('DIGIEST ALGORITHM FOUND');
-			this.DigestAlgorithm = decoder.readUTF8Element(CCNProtocolDTags.DigestAlgorithm); 
+			this.digestAlgorithm = decoder.readUTF8Element(CCNProtocolDTags.DigestAlgorithm); 
 		}
 		if (decoder.peekStartElement(CCNProtocolDTags.Witness)) {
 			if(LOG>4)console.log('WITNESS FOUND FOUND');
@@ -49,7 +49,7 @@
 		//FORCE TO READ A SIGNATURE
 
 			//if(LOG>4)console.log('SIGNATURE FOUND ');
-			this.Signature = decoder.readBinaryElement(CCNProtocolDTags.SignatureBits);	
+			this.signature = decoder.readBinaryElement(CCNProtocolDTags.SignatureBits);	
 			if(LOG>4)console.log('READ SIGNATURE ');
 
 		decoder.readEndElement();
@@ -57,7 +57,7 @@
 };
 
 
-Signature.prototype.encode= function( encoder){
+Signature.prototype.to_ccnb= function( encoder){
     	
 	if (!this.validate()) {
 		throw new Exception("Cannot encode: field values missing.");
@@ -65,7 +65,7 @@
 	
 	encoder.writeStartElement(this.getElementLabel());
 	
-	if ((null != this.DigestAlgorithm) && (!this.DigestAlgorithm.equals(CCNDigestHelper.DEFAULT_DIGEST_ALGORITHM))) {
+	if ((null != this.digestAlgorithm) && (!this.digestAlgorithm.equals(CCNDigestHelper.DEFAULT_DIGEST_ALGORITHM))) {
 		encoder.writeElement(CCNProtocolDTags.DigestAlgorithm, OIDLookup.getDigestOID(this.DigestAlgorithm));
 	}
 	
@@ -74,7 +74,7 @@
 		encoder.writeElement(CCNProtocolDTags.Witness, this.Witness);
 	}
 
-	encoder.writeElement(CCNProtocolDTags.SignatureBits, this.Signature);
+	encoder.writeElement(CCNProtocolDTags.SignatureBits, this.signature);
 
 	encoder.writeEndElement();   		
 };
@@ -83,6 +83,6 @@
 
 
 Signature.prototype.validate = function() {
-		return null != this.Signature;
+		return null != this.signature;
 };
 
diff --git a/js/SignedInfo.js b/js/SignedInfo.js
index b2ff0b2..909545a 100644
--- a/js/SignedInfo.js
+++ b/js/SignedInfo.js
@@ -14,19 +14,19 @@
 
 	//TODO, Check types
 
-    this.Publisher = _publisher; //PublisherPublicKeyDigest
-    this.Timestamp=_timestamp; // CCN Time
-    this.Type=_type; // ContentType
-    this.Locator =_locator;//KeyLocator
-    this.FreshnessSeconds =_freshnessSeconds; // Integer
-    this.FinalBlockID=_finalBlockID; //byte array
+    this.publisher = _publisher; //publisherPublicKeyDigest
+    this.timestamp=_timestamp; // CCN Time
+    this.type=_type; // ContentType
+    this.locator =_locator;//KeyLocator
+    this.freshnessSeconds =_freshnessSeconds; // Integer
+    this.finalBlockID=_finalBlockID; //byte array
 
 };
 
 SignedInfo.prototype.setFields = function(){
 	//BASE64 -> RAW STRING
 	
-	//this.Locator = new KeyLocator(  DataUtils.toNumbersFromString(stringCertificate)  ,KeyLocatorType.CERTIFICATE );
+	//this.locator = new KeyLocator(  DataUtils.toNumbersFromString(stringCertificate)  ,KeyLocatorType.CERTIFICATE );
 	
 	var publicKeyHex = globalKeyManager.publicKey;
 
@@ -49,48 +49,48 @@
 	
 	var publisherKeyDigest = hex_sha256_from_bytes(publicKeyBytes);
 
-	this.Publisher = new PublisherPublicKeyDigest(  DataUtils.toNumbers(  publisherKeyDigest )  );
+	this.publisher = new PublisherPublicKeyDigest(  DataUtils.toNumbers(  publisherKeyDigest )  );
 	
-	//this.Publisher = new PublisherPublicKeyDigest(publisherkey);
+	//this.publisher = new PublisherPublicKeyDigest(publisherkey);
 
 	var d = new Date();
 	
 	var time = d.getTime();
 	
 
-    this.Timestamp = new CCNTime( time );
+    this.timestamp = new CCNTime( time );
     
     if(LOG>4)console.log('TIME msec is');
 
-    if(LOG>4)console.log(this.Timestamp.msec);
+    if(LOG>4)console.log(this.timestamp.msec);
 
     //DATA
-	this.Type = 0;//0x0C04C0;//ContentTypeValue[ContentType.DATA];
+	this.type = 0;//0x0C04C0;//ContentTypeValue[ContentType.DATA];
 	
 	//if(LOG>4)console.log('toNumbersFromString(stringCertificate) '+DataUtils.toNumbersFromString(stringCertificate));
 	
 	console.log('PUBLIC KEY TO WRITE TO CONTENT OBJECT IS ');
 	console.log(publicKeyBytes);
 
-	this.Locator = new KeyLocator(  publicKeyBytes  ,KeyLocatorType.KEY );
+	this.locator = new KeyLocator(  publicKeyBytes  ,KeyLocatorType.KEY );
 
-	//this.Locator = new KeyLocator(  DataUtils.toNumbersFromString(stringCertificate)  ,KeyLocatorType.CERTIFICATE );
+	//this.locator = new KeyLocator(  DataUtils.toNumbersFromString(stringCertificate)  ,KeyLocatorType.CERTIFICATE );
 
 };
 
-SignedInfo.prototype.decode = function( decoder){
+SignedInfo.prototype.from_ccnb = function( decoder){
 
 		decoder.readStartElement( this.getElementLabel() );
 		
 		if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
 			if(LOG>3) console.log('DECODING PUBLISHER KEY');
-			this.Publisher = new PublisherPublicKeyDigest();
-			this.Publisher.decode(decoder);
+			this.publisher = new PublisherPublicKeyDigest();
+			this.publisher.from_ccnb(decoder);
 		}
 
 		if (decoder.peekStartElement(CCNProtocolDTags.Timestamp)) {
-			this.Timestamp = decoder.readDateTime(CCNProtocolDTags.Timestamp);
-			if(LOG>4)console.log('TIMESTAMP FOUND IS  '+this.Timestamp);
+			this.timestamp = decoder.readDateTime(CCNProtocolDTags.Timestamp);
+			if(LOG>4)console.log('TIMESTAMP FOUND IS  '+this.timestamp);
 
 		}
 
@@ -98,72 +98,72 @@
 			binType = decoder.readBinaryElement(CCNProtocolDTags.Type);//byte [] 
 		
 			
-			//TODO Implement Type of Key Reading
+			//TODO Implement type of Key Reading
 			
 			if(LOG>4)console.log('Binary Type of of Signed Info is '+binType);
 
-			this.Type = binType;
+			this.type = binType;
 			
 			
-			//TODO Implement Type of Key Reading
+			//TODO Implement type of Key Reading
 			
 			
-			if (null == this.Type) {
+			if (null == this.type) {
 				throw new Exception("Cannot parse signedInfo type: bytes.");
 			}
 			
 		} else {
-			this.Type = ContentType.DATA; // default
+			this.type = ContentType.DATA; // default
 		}
 		
 		if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
-			this.FreshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
-			if(LOG>4) console.log('FRESHNESS IN SECONDS IS '+ this.FreshnessSeconds);
+			this.freshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds);
+			if(LOG>4) console.log('FRESHNESS IN SECONDS IS '+ this.freshnessSeconds);
 		}
 		
 		if (decoder.peekStartElement(CCNProtocolDTags.FinalBlockID)) {
-			this.FinalBlockID = decoder.readBinaryElement(CCNProtocolDTags.FinalBlockID);
+			this.finalBlockID = decoder.readBinaryElement(CCNProtocolDTags.FinalBlockID);
 		}
 		
 		if (decoder.peekStartElement(CCNProtocolDTags.KeyLocator)) {
-			this.Locator = new KeyLocator();
-			this.Locator.decode(decoder);
+			this.locator = new KeyLocator();
+			this.locator.from_ccnb(decoder);
 		}
 				
 		decoder.readEndElement();
 };
 
-SignedInfo.prototype.encode = function( encoder)  {
+SignedInfo.prototype.to_ccnb = function( encoder)  {
 		if (!this.validate()) {
 			throw new Exception("Cannot encode : field values missing.");
 		}
 		encoder.writeStartElement(this.getElementLabel());
 		
-		if (null!=this.Publisher) {
-			if(LOG>3) console.log('ENCODING PUBLISHER KEY' + this.Publisher.PublisherPublicKeyDigest);
+		if (null!=this.publisher) {
+			if(LOG>3) console.log('ENCODING PUBLISHER KEY' + this.publisher.publisherPublicKeyDigest);
 
-			this.Publisher.encode(encoder);
+			this.publisher.to_ccnb(encoder);
 		}
 
-		if (null!=this.Timestamp) {
-			encoder.writeDateTime(CCNProtocolDTags.Timestamp, this.Timestamp );
+		if (null!=this.timestamp) {
+			encoder.writeDateTime(CCNProtocolDTags.Timestamp, this.timestamp );
 		}
 		
-		if (null!=this.Type && this.Type !=0) {
+		if (null!=this.type && this.type !=0) {
 			
-			encoder.writeElement(CCNProtocolDTags.Type, this.Type);
+			encoder.writeElement(CCNProtocolDTags.type, this.type);
 		}
 		
-		if (null!=this.FreshnessSeconds) {
-			encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.FreshnessSeconds);
+		if (null!=this.freshnessSeconds) {
+			encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, this.freshnessSeconds);
 		}
 
-		if (null!=this.FinalBlockID) {
-			encoder.writeElement(CCNProtocolDTags.FinalBlockID, this.FinalBlockID);
+		if (null!=this.finalBlockID) {
+			encoder.writeElement(CCNProtocolDTags.FinalBlockID, this.finalBlockID);
 		}
 
-		if (null!=this.Locator) {
-			this.Locator.encode(encoder);
+		if (null!=this.locator) {
+			this.locator.to_ccnb(encoder);
 		}
 
 		encoder.writeEndElement();   		
@@ -185,7 +185,7 @@
 SignedInfo.prototype.validate = function() {
 		// We don't do partial matches any more, even though encoder/decoder
 		// is still pretty generous.
-		if (null ==this.Publisher || null==this.Timestamp ||null== this.Locator)
+		if (null ==this.publisher || null==this.timestamp ||null== this.locator)
 			return false;
 		return true;
 };
diff --git a/js/encoding/EncodingUtils.js b/js/encoding/EncodingUtils.js
index 653bafd..d90a240 100644
--- a/js/encoding/EncodingUtils.js
+++ b/js/encoding/EncodingUtils.js
@@ -65,7 +65,7 @@
 
 	var faceInstance = new FaceInstance();
 
-	faceInstance.decode(decoder);
+	faceInstance.from_ccnb(decoder);
 
 	return faceInstance;
 	
@@ -113,7 +113,7 @@
 	
 	forwardingEntry = new ForwardingEntry();
 
-	forwardingEntry.decode(decoder);
+	forwardingEntry.from_ccnb(decoder);
 
 	return forwardingEntry;
 	
@@ -130,11 +130,11 @@
     else if (co==-2)
 	output+= "CONTENT NAME IS EMPTY"
     else{
-	if(co.name!=null && co.name.Components!=null){
+	if(co.name!=null && co.name.components!=null){
 	    output+= "NAME: ";
 	    
-	    for(var i=0;i<co.name.Components.length;i++){
-		output+= "/"+ DataUtils.toString(co.name.Components[i]);
+	    for(var i=0;i<co.name.components.length;i++){
+		output+= "/"+ DataUtils.toString(co.name.components[i]);
 	    }
 	    output+= "<br />";
 	    output+= "<br />";
@@ -152,36 +152,36 @@
 	    output+= "<br />";
 	    output+= "<br />";
 	}
-	if(co.Signature !=null && co.Signature.Signature!=null){
-	    output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+	if(co.signature !=null && co.signature.signature!=null){
+	    output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
 	    
 	    output+= "<br />";
 	    output+= "<br />";
 	}
-	if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
-	    output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+	if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
+	    output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
 	    
 	    output+= "<br />";
 	    output+= "<br />";
 	}
-	if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+	if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
 	    var d = new Date();
-	    d.setTime( co.SignedInfo.Timestamp.msec );
+	    d.setTime( co.signedInfo.timestamp.msec );
 	    
 	    var bytes = [217, 185, 12, 225, 217, 185, 12, 225];
 	    
 	    output += "TimeStamp: "+d;
 	    output+= "<br />";
-	    output += "TimeStamp(number): "+ co.SignedInfo.Timestamp.msec;
+	    output += "TimeStamp(number): "+ co.signedInfo.timestamp.msec;
 	    
 	    output+= "<br />";
 	}
-	if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Certificate!=null){
-	    var tmp = DataUtils.toString(co.SignedInfo.Locator.Certificate);
+	if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.certificate!=null){
+	    var tmp = DataUtils.toString(co.signedInfo.locator.certificate);
 	    var publickey = rstr2b64(tmp);
-	    var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.Certificate).toLowerCase();
-	    var publickeyString = DataUtils.toString(co.SignedInfo.Locator.Certificate);
-	    var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+	    var publickeyHex = DataUtils.toHex(co.signedInfo.locator.certificate).toLowerCase();
+	    var publickeyString = DataUtils.toString(co.signedInfo.locator.certificate);
+	    var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
 	    var input = DataUtils.toString(co.rawSignatureData);
 	    
 	    output += "DER Certificate: "+publickey ;
@@ -201,7 +201,7 @@
 	    if(LOG>2) console.log(" Signature is");
 	    if(LOG>2) console.log( signature );
 	    //if(LOG>2) console.log(" Signature NOW IS" );
-	    //if(LOG>2) console.log(co.Signature.Signature);
+	    //if(LOG>2) console.log(co.signature.signature);
 
 	    var x509 = new X509();
 	    x509.readCertPEM(publickey);
@@ -250,18 +250,18 @@
 	    else
 		output += 'SIGNATURE INVALID';
 	    
-	    //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+	    //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 	    
 	    output+= "<br />";
 	    output+= "<br />";
 	    
 	    //if(LOG>4) console.log('str'[1]);
 	}
-	if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
-	    var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
-	    var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
-	    var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
-	    var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+	if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
+	    var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+	    var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+	    var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
+	    var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
 	    var input = DataUtils.toString(co.rawSignatureData);
 	    
 	    output += "DER Certificate: "+publickey ;
@@ -278,7 +278,7 @@
 	    
 	    if(LOG>2) console.log(" Signature NOW IS" );
 	    
-	    if(LOG>2) console.log(co.Signature.Signature);
+	    if(LOG>2) console.log(co.signature.signature);
 	    
 	    /*var x509 = new X509();
 	      
@@ -340,7 +340,7 @@
 	    else
 		output += 'SIGNATURE INVALID';
 	    
-	    //output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+	    //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 	    
 	    output+= "<br />";
 	    output+= "<br />";
diff --git a/js/lwNDN.js b/js/lwNDN.js
index 717ac07..c6658cd 100644
--- a/js/lwNDN.js
+++ b/js/lwNDN.js
@@ -70,13 +70,13 @@
 		
 		var co = this.get("/%C1.M.S.localhost/%C1.M.SRV/ccnd");
 		
-		if(!co || !co.SignedInfo || !co.SignedInfo.Publisher || !co.SignedInfo.Publisher.PublisherPublicKeyDigest){
+		if(!co || !co.signedInfo || !co.signedInfo.publisher || !co.signedInfo.publisher.publisherPublicKeyDigest){
 			alert("Cannot contact router");
 			
 			return null;
 		}
 		
-		var ccnxnodename = co.SignedInfo.Publisher.PublisherPublicKeyDigest;
+		var ccnxnodename = co.signedInfo.publisher.publisherPublicKeyDigest;
 		
 		name = name.trim();
 		
diff --git a/js/publish-data.html b/js/publish-data.html
index 1534aa9..e2574eb 100644
--- a/js/publish-data.html
+++ b/js/publish-data.html
@@ -110,7 +110,7 @@
 			else if (co==-2)
 				output+= "CONTENT NAME IS EMPTY"
 			else{
-				if(co.name!=null && co.Name.Components!=null){
+				if(co.name!=null && co.Name.components!=null){
 					output+= "NAME: ";
 					
 					for(var i=0;i<co.Name.Components.length;i++){
@@ -132,14 +132,14 @@
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.Signature !=null && co.Signature.Signature!=null){
+				if(co.signature !=null && co.signature.signature!=null){
 					
-					output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
+					output += "SIGNATURE(hex): "+ toHex(co.signature.signature);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.Key!=null){
+				if(co.signedInfo!=null && co.SignedInfo.locator!=null && co.SignedInfo.Locator.Key!=null){
 					
 					output += "PUBLISHER KEY: "+ toHex(co.SignedInfo.Locator.Key);
 					
diff --git a/js/request-data.html b/js/request-data.html
index b86170b..5b7e0ab 100644
--- a/js/request-data.html
+++ b/js/request-data.html
@@ -98,11 +98,11 @@
 			if(co==null)
 				output+= "NO CONTENT FOUND"
 			else{
-				if(co.name!=null && co.name.Components!=null){
+				if(co.name!=null && co.name.components!=null){
 					output+= "NAME: ";
 					
-					for(var i=0;i<co.name.Components.length;i++){
-						output+= "/"+ DataUtils.toString(co.name.Components[i]);
+					for(var i=0;i<co.name.components.length;i++){
+						output+= "/"+ DataUtils.toString(co.name.components[i]);
 					}
 					output+= "<br />";
 					output+= "<br />";
@@ -121,39 +121,39 @@
 					output+= "<br />";
 				}
 				
-				if(co.Signature !=null && co.Signature.Signature!=null){
+				if(co.signature !=null && co.signature.signature!=null){
 					
-					output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+					output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+				if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
 					
-					output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+					output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+				if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
 					
-					output += "TimeStamp: "+ co.SignedInfo.Timestamp.getJavascriptDate();
+					output += "TimeStamp: "+ co.signedInfo.timestamp.getJavascriptDate();
 					
 					output+= "<br />";
 					output+= "<br />";
 					
-					output += "TimeStamp (MILLISECONDS): "+ co.SignedInfo.Timestamp.msec;
+					output += "TimeStamp (MILLISECONDS): "+ co.signedInfo.timestamp.msec;
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+				if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
 					
-					var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
-					var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
-					var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
+					var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+					var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+					var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
 					
-					var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+					var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
 					
 					
 					var input = DataUtils.toString(co.rawSignatureData);
@@ -173,7 +173,7 @@
 					
 					if(LOG>2) console.log(" Signature NOW IS" );
 					
-					if(LOG>2) console.log(co.Signature.Signature);
+					if(LOG>2) console.log(co.signature.signature);
 					
 					
 					/*var x509 = new X509();
@@ -245,7 +245,7 @@
 						
 					
 					
-					//output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+					//output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 					
 					output+= "<br />";
 					output+= "<br />";
diff --git a/js/testing/test-decode-FaceInstance.html b/js/testing/test-decode-FaceInstance.html
index 7818e55..196afbe 100644
--- a/js/testing/test-decode-FaceInstance.html
+++ b/js/testing/test-decode-FaceInstance.html
@@ -87,37 +87,37 @@
 			
 			var output ="";
 			
-			if(faceInstance.PublisherPublicKeyDigest!=null ){
+			if(faceInstance.publisherPublicKeyDigest!=null ){
 				output+= "PublisherPublicKeyDigest: ";
 				
-					output+=  DataUtils.toHex(faceInstance.PublisherPublicKeyDigest.PublisherPublicKeyDigest);
+					output+=  DataUtils.toHex(faceInstance.publisherPublicKeyDigest.publisherPublicKeyDigest);
 					
 					//output+= "PUBLISHER ID TYPE: ";
-					//output+=  faceInstance.PublisherPublicKeyDigest.PublisherPublicKeyDigest;
+					//output+=  faceInstance.publisherPublicKeyDigest.PublisherPublicKeyDigest;
 					
 				output+= "<br />";
 				output+= "<br />";
 
 			}
 			
-			if(faceInstance.FaceID!=null){
+			if(faceInstance.faceID!=null){
 				output+= "FaceID: ";
 				
-				output+= faceInstance.FaceID;
+				output+= faceInstance.faceID;
 				output+= "<br />";
 			}
 			
-			if(faceInstance.IPProto!=null){
+			if(faceInstance.ipProto!=null){
 				output+= "IPProto: ";
 				
-				output+= faceInstance.IPProto;
+				output+= faceInstance.ipProto;
 				output+= "<br />";
 			}
 			
-			if(faceInstance.Host!=null){
+			if(faceInstance.host!=null){
 				output+= "Host: ";
 				
-				output+= faceInstance.Host;
+				output+= faceInstance.host;
 				output+= "<br />";
 			}
 			
@@ -127,14 +127,14 @@
 				output+= faceInstance.Port;
 				output+= "<br />";
 			}
-			if(faceInstance.FreshnessSeconds!=null){
+			if(faceInstance.freshnessSeconds!=null){
 				output+= "FreshnessSeconds: ";
 				
-				output+= faceInstance.FreshnessSeconds;
+				output+= faceInstance.freshnessSeconds;
 				output+= "<br />";
 			}
 			
-			/*if(interest.name!=null && interest.name.Components!=null){
+			/*if(interest.name!=null && interest.name.components!=null){
 				output+= "NAME: ";
 				
 				for(var i=0;i<interest.Name.Components.length;i++){
diff --git a/js/testing/test-decode-Interest+Forwarding+Entry.html b/js/testing/test-decode-Interest+Forwarding+Entry.html
index 0ece80f..5e5e1c0 100644
--- a/js/testing/test-decode-Interest+Forwarding+Entry.html
+++ b/js/testing/test-decode-Interest+Forwarding+Entry.html
@@ -91,11 +91,11 @@
 			var output ="";
 			
 			
-			if(interest.name!=null && interest.name.Components!=null){
+			if(interest.name!=null && interest.name.components!=null){
 				output+= "NAME: ";
 				
-				for(var i=0;i<interest.name.Components.length;i++){
-					output+= "/"+ DataUtils.toString(interest.name.Components[i]);
+				for(var i=0;i<interest.name.components.length;i++){
+					output+= "/"+ DataUtils.toString(interest.name.components[i]);
 				}
 				output+= "<br />";
 				output+= "<br />";
@@ -168,7 +168,7 @@
 			if(interest.publisherPublicKeyDigest!=null ){
 				output+= "PUBLISHER PUBLIC KEY DIGEST: ";
 				
-				output+=  interest.publisherPublicKeyDigest.PublisherPublicKeyDigest;
+				output+=  interest.publisherPublicKeyDigest.publisherPublicKeyDigest;
                                         
 				output+= "<br />";
 				output+= "<br />";
@@ -192,10 +192,10 @@
 				output+= "<br />";
 			}
 			
-			if(interest.name.Components[3] !=null){
+			if(interest.name.components[3] !=null){
 				
 				
-				var input = DataUtils.toHex(interest.name.Components[3]) ;
+				var input = DataUtils.toHex(interest.name.components[3]) ;
 
 				var contentObject = decodeHexContentObject(input);
 				
@@ -217,11 +217,11 @@
 				////////////////////////////////////////
 				
 
-				if(co.name!=null && co.name.Components!=null){
+				if(co.name!=null && co.name.components!=null){
 					output+= "NAME: ";
 					
-					for(var i=0;i<co.name.Components.length;i++){
-						output+= "/"+ DataUtils.toString(co.name.Components[i]);
+					for(var i=0;i<co.name.components.length;i++){
+						output+= "/"+ DataUtils.toString(co.name.components[i]);
 					}
 					output+= "<br />";
 					output+= "<br />";
@@ -239,65 +239,65 @@
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.Signature !=null && co.Signature.Signature!=null){
+				if(co.signature !=null && co.signature.signature!=null){
 					
-					output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
+					output += "SIGNATURE(hex): "+ DataUtils.toHex(co.signature.signature);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+				if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
 					
-					output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+					output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+				if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
 					var d = new Date();
-					d.setTime( co.SignedInfo.Timestamp.msec );
+					d.setTime( co.signedInfo.timestamp.msec );
 					
 					var bytes = [217, 185, 12, 225, 217, 185, 12, 225];
 					
 					output += "TimeStamp: "+d;
 					output+= "<br />";
-					output += "TimeStamp(number): "+ co.SignedInfo.Timestamp.msec;
+					output += "TimeStamp(number): "+ co.signedInfo.timestamp.msec;
 					
 					
 					output+= "<br />";
 				}
-			    if(co.SignedInfo !=null && co.SignedInfo.Type!=null){
+			    if(co.signedInfo !=null && co.signedInfo.type!=null){
 
-					output += "Type: "+co.SignedInfo.Type;
+					output += "Type: "+co.signedInfo.type;
 					output+= "<br />";
 					output+= "<br />";
 				}
-			    if(co.SignedInfo !=null && co.SignedInfo.Locator!=null){
+			    if(co.signedInfo !=null && co.signedInfo.locator!=null){
 
-					output += "Locator: "+co.SignedInfo.Locator.Type;
+					output += "Locator: "+co.signedInfo.locator.type;
 					output+= "<br />";
 					output+= "<br />";
 				}
-			    if(co.SignedInfo !=null && co.SignedInfo.FreshnessSeconds!=null){
+			    if(co.signedInfo !=null && co.signedInfo.freshnessSeconds!=null){
 
-					output += "FreshnessSeconds: "+co.SignedInfo.FreshnessSeconds;
+					output += "FreshnessSeconds: "+co.signedInfo.freshnessSeconds;
 					output+= "<br />";
 					output+= "<br />";
 				}
-			    if(co.SignedInfo !=null && co.SignedInfo.FinalBlockID!=null){
+			    if(co.signedInfo !=null && co.signedInfo.finalBlockID!=null){
 
-					output += "FinalBlockID: "+co.SignedInfo.FinalBlockID;
+					output += "FinalBlockID: "+co.signedInfo.finalBlockID;
 					output+= "<br />";
 					output+= "<br />";
 				}
 				
-				if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+				if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
 					
-					var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
-					var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
-					var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
+					var publickey = rstr2b64(DataUtils.toString(co.signedInfo.locator.publicKey));
+					var publickeyHex = DataUtils.toHex(co.signedInfo.locator.publicKey).toLowerCase();
+					var publickeyString = DataUtils.toString(co.signedInfo.locator.publicKey);
 					
-					var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
+					var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
 					
 					
 					var input = DataUtils.toString(co.rawSignatureData);
@@ -319,7 +319,7 @@
 					
 					if(LOG>2) console.log(" Signature NOW IS" );
 					
-					if(LOG>2) console.log(co.Signature.Signature);
+					if(LOG>2) console.log(co.signature.signature);
 					
 					
 					/*var x509 = new X509();
@@ -387,7 +387,7 @@
 					else
 						output += 'SIGNATURE INVALID';
 
-					//output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+					//output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 					
 					output+= "<br />";
 					output+= "<br />";
@@ -408,40 +408,40 @@
 				
 				//var output ="";
 				
-				if(forwardingEntry.Action!=null ){
+				if(forwardingEntry.action!=null ){
 					output+= "Action: ";
 					
-					output+=  DataUtils.toHex(forwardingEntry.Action);
+					output+=  DataUtils.toHex(forwardingEntry.action);
 						
 					output+= "<br />";
 					output+= "<br />";
 				}
 				
-				if(forwardingEntry.PrefixName!=null){
+				if(forwardingEntry.prefixName!=null){
 					output+= "PrefixName: ";
 					
-					output+= forwardingEntry.PrefixName.getName();
+					output+= forwardingEntry.prefixName.getName();
 					output+= "<br />";
 				}
 				
-				if(forwardingEntry.CCNID!=null){
-					output+= "CCNID: ";
+				if(forwardingEntry.ccndID!=null){
+					output+= "ccndID: ";
 					
-					output+= forwardingEntry.CCNID;
+					output+= forwardingEntry.ccndID;
 					output+= "<br />";
 				}
 				
-				if(forwardingEntry.Flags!=null){
+				if(forwardingEntry.flags!=null){
 					output+= "Flags: ";
 					
-					output+= forwardingEntry.Flags;
+					output+= forwardingEntry.flags;
 					output+= "<br />";
 				}
 				
-				if(forwardingEntry.Lifetime!=null){
+				if(forwardingEntry.lifetime!=null){
 					output+= "Lifetime: ";
 					
-					output+= forwardingEntry.Lifetime;
+					output+= forwardingEntry.lifetime;
 					output+= "<br />";
 				}
 
diff --git a/js/testing/test-encode-decode-ContentObject-bis.html b/js/testing/test-encode-decode-ContentObject-bis.html
index f66cae5..6e8dad9 100644
--- a/js/testing/test-encode-decode-ContentObject-bis.html
+++ b/js/testing/test-encode-decode-ContentObject-bis.html
@@ -116,11 +116,11 @@
 			else if (co==-2)
 				output+= "CONTENT NAME IS EMPTY"
 			else{
-				if(co.name!=null && co.name.Components!=null){
+				if(co.name!=null && co.name.components!=null){
 					output+= "NAME: ";
 					
-					for(var i=0;i<co.name.Components.length;i++){
-						output+= "/"+ toString(co.name.Components[i]);
+					for(var i=0;i<co.name.components.length;i++){
+						output+= "/"+ toString(co.name.components[i]);
 					}
 					output+= "<br />";
 					output+= "<br />";
@@ -138,34 +138,34 @@
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.Signature !=null && co.Signature.Signature!=null){
+				if(co.signature !=null && co.signature.signature!=null){
 					
-					output += "SIGNATURE(hex): "+ toHex(co.Signature.Signature);
+					output += "SIGNATURE(hex): "+ toHex(co.signature.signature);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
+				if(co.signedInfo !=null && co.signedInfo.publisher!=null && co.signedInfo.publisher.publisherPublicKeyDigest!=null){
 					
-					output += "Publisher Public Key Digest(hex): "+ toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
+					output += "Publisher Public Key Digest(hex): "+ toHex(co.signedInfo.publisher.publisherPublicKeyDigest);
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
+				if(co.signedInfo !=null && co.signedInfo.timestamp!=null){
 					
-					output += "TimeStamp(hex): "+ co.SignedInfo.Timestamp.date;
+					output += "TimeStamp(hex): "+ co.signedInfo.timestamp.date;
 					
 					output+= "<br />";
 					output+= "<br />";
 				}
-				if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
+				if(co.signedInfo!=null && co.signedInfo.locator!=null && co.signedInfo.locator.publicKey!=null){
 					
-					var publickey = rstr2b64(toString(co.SignedInfo.Locator.PublicKey));
-					var publickeyHex = toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
-					var publickeyString = toString(co.SignedInfo.Locator.PublicKey);
+					var publickey = rstr2b64(toString(co.signedInfo.locator.publicKey));
+					var publickeyHex = toHex(co.signedInfo.locator.publicKey).toLowerCase();
+					var publickeyString = toString(co.signedInfo.locator.publicKey);
 					
-					var signature = toHex(co.Signature.Signature).toLowerCase();
+					var signature = toHex(co.signature.signature).toLowerCase();
 					
 					
 					var input = toString(co.rawSignatureData);
@@ -185,7 +185,7 @@
 					
 					if(LOG>2) console.log(" Signature "+signature );
 					if(LOG>2) console.log(" Signature NOW IS" );
-					if(LOG>2) console.log(co.Signature.Signature);
+					if(LOG>2) console.log(co.signature.signature);
 					
 					
 					var x509 = new X509();
@@ -231,7 +231,7 @@
 						
 					
 					
-					//output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
+					//output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 					
 					output+= "<br />";
 					output+= "<br />";
diff --git a/js/testing/test-encode-decode-Interest.html b/js/testing/test-encode-decode-Interest.html
index dd3e3b4..d957176 100644
--- a/js/testing/test-encode-decode-Interest.html
+++ b/js/testing/test-encode-decode-Interest.html
@@ -100,13 +100,13 @@
 			
 			var output ="";
 			
-			if(interest.name!=null && interest.name.Components!=null){
+			if(interest.name!=null && interest.name.components!=null){
 				output+= "NAME: ";
 				
 				
 				output+= interest.name.getName();
 				
-				/*for(var i=0;i<interest.name.Components.length;i++){
+				/*for(var i=0;i<interest.name.components.length;i++){
 					output+= "/"+ DataUtils.toString(interest.name.Components[i]);
 				}*/
 				
@@ -127,10 +127,10 @@
 			if(interest.publisherID!=null ){
 				output+= "PUBLISHER ID: ";
 				
-					output+=  interest.publisherID.PublisherID;
+					output+=  interest.publisherID.publisherID;
 					
 					output+= "PUBLISHER ID TYPE: ";
-					output+=  interest.publisherID.PublisherType;
+					output+=  interest.publisherID.publisherType;
 				output+= "<br />";
 				output+= "<br />";
 			}
