Added criteria linking, but it doesn't work quite yet.
Linking seems to work now.
Various changes. So many, in fact, that I have no idea what to put here.