First stab at resource selection algorithms

So far, it's a bit of a hatchet job. Needs some lovin.

I haven't really reviewed carefully to make sure this all makes sense yet. I suspect it mostly doesn't, but it should be an ok scaffold to get things started.