Use ||= idiom
Relax mongo driver requirement to permit 1.9
changed deleted cursor.next_object method to cursor.next
Merge pull request #518 from jamesbowles/master

changed deleted cursor.next_object method to cursor.next
Merge branch 'master' of git://github.com/jnunemaker/mongomapper
Minor improvements to type cast speeds. Important since they're called so often.

Remove instance #extends. They torch the ruby method cache! This is Very Very Bad. Don't do identity map stuff when the identity map is disabled.

Big changes to load behavior to improve load speeds substantially.

The big change here is that when loading from the database, we use
an #internal_write_key method that isn't eligible for plugins to
overwrite. Previously, things like #dirty_key's write_key would
be invoked when loading from the DB, which in turn invoked read_key
and a whole other chain of things. This massively slowed down read
speeds.

Other changes have been made to improve internal_write_key. First off,
uncast values are now stored in write (by the app, not the DB), and
only then from the Rails plugin, as that's the functionality that is
concerned with uncast values. It's now a simple hash lookup rather
than being a whole mess of ivars.

Keys#keys now copies the class.keys to an ivar when it's used. This
method is used very frequently, and avoiding the extra function
call has substantial benefit when you start adding it up.

is_a? was replaced with instance_of? in a number of places; this is
faster when you want to compare types directly, rather than the
inheritance hierarchiy.

We're testing !foo rather than foo.nil? in a number of places for
similar reasons.

Several tests which were too brittle have been fixed.

These changes have resulted in something approaching a 1000% speed
increase when reading from the database.

Dirty doesn't need initialize_from_database anymore

Since MM depends on activesupport already, just go ahead and include the Time.zone patch so we can remove #try

Performance improvements to boolean#from_mongo

Eliminate a bunch of uninitialized ivar warnings. Slightly improve the runtime of Key#get by avoiding a few method calls.

Remove spec that shouldn't have made it into this branch
Add test suite converted to rspec

Update gemfiles for travis builds. Minor spec fixes for 1.8.7 - not passing on 1.8.7 yet

Add common gemfile
Turn embedded callbacks off until a callback is actually defined.

Conflicts:
	spec/functional/callbacks_spec.rb
Fix syntax for Ruby 1.8.7
Merge branch 'load_speed_fixes'
Merge branch 'rspec_suite'
Merge branch 'embedded_callbacks_fix'
Get MM building on Rails 4.0. Add Ruby 2.0 and Rails 4 to the Travis test matrix.
Add specs for embedded callback deferral
Remove old test suite and update watchr scripts to point to rspec instead
Bump plucky version and fix the build list to reflect the spec suite change
Add build status image to README
Limit subclass scopes to subclasses. Closes #512.

Prior to this change, scopes added to subclasses would be visible on the
superclass
Fix run-all watchr task
Fix spec; shoulda syntax isn't valid here