Numerous improvements

I make no guarantees about documenting the process here.