Added back in settings and checks.

I mostly adjusted the existing code, so it may be buggy.  But we should
be pretty close to what we need for 2.0.