Add links to gir files, and tidy up code