Refactor Euler 003 to not use class variables in global scope.