handle include_root_in_json in way compatible with ActiveModel::Dirty

remove override of Base#encode
add class_attribute :include_only_top_root_in_json
in Base#as_json use root but delete from options for nested resources