mongoid/mongoid — pull request #3304 by arthurnn (2013-10-04 21:10:47+00:00)
Title: Refactor session

This PR is:
#3300 + https://github.com/mongoid/mongoid/commit/33cb98fdb8533e7f80ff04fa5080a70fbdcda705

### Problem
Logic to get database, collection, session overwrites was way to confusing, as we have multiple source of data, and they were all handled case by case on the session.rb module.

### Solution
Split those storage options into 3 layers of modules,
```ruby
StorageOptions ## Responsible for dealing with class level overwrites
ThreadOptions ## Responsible for dealing with thread level overwrites
Options ## Responsible for dealing with .with() options
```
They are defined in that order so the chain of methods will be preserved.

Let me know what do you think @durran before I merge this in.