to_json in dm-serializers throws exceptions on included associations.

I have been starting to experiment with DataMapper and have thus
far been pretty pleased; unfortunately, I recently ran into a bug
that is preventing me from continuing to use it in projects. When
including dm-serializers and calling the "to_json" method on
anything with included associations (via :methods), I get an
exception thrown. (I will note that to_xml seems to work
flawlessly.)

I would also note that using :methods is not well documented.
The only place I found reference to it was on
http://github.com/datamapper/dm-more/tree/master/dm-serializer#readme,
in one little sentence under "How it works". Since I would imagine
that serializing an object with associations to be a common use
case (it certainly was in my case, building a JSON API with Sinatra
and DataMapper), it would probably be wise to document this in more
detail.

The old code assumed that the object passed in was either nil
or a Hash, or something that can be coerced into a Hash. However,
in certain cases, such as when JSON itself is handling
serialization, it will pass in a JSON::Ext::Generator::State
object. This fix will ignore anything other than a Hash passed
in.