Extract rw_config into module, and clean it up a little.

### WHAT

Move `rw_config` into a module, and include that module in `Authlogic::ActsAsAuthentic::Base` and `Authlogic::Session::Foundation`. Tests included.

### WHY

Currently `rw_config` is defined in the 2 modules, but their implementation is slightly different. We should make this easier to understand and test it.