support ruby 1.9.3

Ruby 1.9.3 does not provide a size method on enumerables and
will not allow binding an unbound method onto a module that
is not a subclass of the source module. This commit resolves
these two issues in a way compatible with ruby 1.9 -> 2.1