Update 14_collatz.rb

Refactored to bring runtime under 1 minute.