resource: bug fixes

* to_json will have a JSON::Ext::Generator::State as an argument when
serializing arrays
* Resources equality was broken due to class addresses being appended to
their string representation

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
account: add custom fields support

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>