Lots of rework, eliminate need for special kernel patch

With this patch I've eliminated the need for the general memory patch,
it should work fine without it.  The MIPS specific patch is still required
for MIPS.

Lots of other small cleanups. too.