Fix dict encoding and incorrect test. Bencoded dicts must encode the key...

...s in sorted order.