Fix a bug in pair2adjacency.py

Now the incoming and outgoing lists are updated correctly.
Add documentation to pair2adjacency.py

The documentation is in literate style and is meant to be processed by pycco