Modify snapshot to take private library + inferred code as truth

A major part of making this work involved refactoring `getPackageRecords` -- basically, I split up the logic within `getPackageRecords` based on what type of package it was trying to infer a record from.

I think it's a lot more clear / easy to read now, and will definitely make it easier to maintain in the long run, but there may be some missing bits.

Note that snapshot no longer has an `orphan.check` argument. Previously, an installed package was considered an 'orphan' if it was installed in the private library but not used by the code; now, snapshot just takes the library state and writes it to the lockfile (ignoring what the usage of that library might be).