Get rid of unnecessary controller reference in poll template.
Detect arrays for serialization using respond_to?(:to_ary).

This is the way AMS detects arrays, and is more robust than checking
is_a? for whitelisted classes. For example, this works for
ActiveRecord::AssociationRelation which the current logic does not
handle.
Merge pull request #2268 from vikhyat/poll-plugin

Get rid of unnecessary controller reference in poll template
Merge pull request #2270 from vikhyat/serialize-array-detection

Detect arrays for serialization using respond_to?(:to_ary)