dictionary.py can now return reversed dictionary

Update calls to it in encode and decode to reflect changes.