Support Ruby 2.0 to_h for Resource

Fixes #18