Implement Array#replace

replace_spec.rb passes now.