Update/refactor the link checker

Update and refactor the link checker API client. It had become out of
date due to changes in the CKAN extension. Also refactor it to make the
code testable and add the beginning of a test module for it.
Fix a couple of bugs

Some bugs found by integration testing