Refactor ctx.ResolvePackage

Packages now carry the text name of their package, not
a *gogo.Package reference. This helps avoiding resolution loops
while resolving an XTest file.
Ensure build/Test() resolves all test dependencies