Solve problem 3 and rework as an object

Also used the #tr method instead of #gsub. It's like it was tailor made
for this problem.