fixed track by index for messages in chat2 & typescript d.ts for tcp and udp

TESTED: grunt test & manual test of peer-connection chat2 demo 
in general, not a big fan of keeping commented out code.