Improved dependency checking

Have created new "Get appropriate Link" method that checks that inputs
have not previously been resolved (avoiding circular requirements).

Currently program has a "Failure mode" where it just admits defeat and
gives up. This happens approx 20% of time.