Refactors fraction generator into fraction_problem class with methods.