Finalized most of the mixed-model code. Need to split it up into relevant headers and attempt to compile (and fix).