~ Fix bug in torrent bencode instance.

Also add encoding tests for torrent module.