Move registration of 'link' helper down so it can use debug()