Implementation of Ruby's array flatten method, in Ruby