Renamed annotate.py to graphlib, moved common function into graphlib