changed use of #const_defined? to work with Ruby 2.0 <=