Move links functionality into pkg

This pr removes the *Container dependency on links and moves the code into a sub pkg.