[#74677798] Update scopes to samples or ids

Rails scopes are smart enough to accept an array of
ActiveRecord objects or ids. This switch allows us
to reduce the memory footprint elsewhere.
[#74677798] Reduce memory requirements for manifests

Large manifests used the sample as the key in a hash.
This caused issues with larger manifests, as they'd
keep all samples in memory.

This is not required, and switching to sample.id
relieves the memory issues experienced.
Merge pull request #893 from JamesGlover/74677798_ss33_-_resolve_ram_problem_for_large_sample_manifests

74677798 ss33   resolve ram problem for large sample manifests