Use method modifer to override role-provided method

Calling the role's method directly means nothing else can modify it.
Only call ->as_hash on actual objects when recursing

->can returns true for class names too, but actually calling ->as_hash
on a class consuming this role would throw an exception in
->keys_for_as_hash.
Merge pull request #377 from ilmari/as-hash-cleanup

as_hash cleanup