rewrite the ECM interface
actually fix the source of the random (but unlikely) doctest failures
Combine ECM-GMP with Baillie-PSW for prime factorization
Mergend in 6.2.beta1
integrate better with Integer.is_prime
Limit the GAP command line history
Trac #15819: GAP interface memory leak

All commands in the GAP command line interface end up in the
undocumented GAP variable `CommandLineHistory`. This patch limits it to
avoid a memory leak. See https://groups.google.com/d/msg/sage-
support/evFx3oE02zU/yY24JNbHfPQJ

URL: http://trac.sagemath.org/15819
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): David Roe
Trac #15443: Random time outs in ecm.py

Infrequently, I get this doctest failure:
{{{
sage -t --long src/sage/interfaces/ecm.py
    Timed out
**********************************************************************
Tests run before process (pid=8764) timed out:
sage: f = ECM() ## line 169 ##
sage: n = 508021860739623467191080372196682785441177798407961 ## line
170 ##
sage: f.one_curve(n, B1=10000, sigma=11) ## line 171 ##
[1, 508021860739623467191080372196682785441177798407961]
sage: f.one_curve(n, B1=10000, sigma=1022170541) ## line 173 ##
[79792266297612017, 6366805760909027985741435139224233]
sage: n = 432132887883903108009802143314445113500016816977037257 ## line
175 ##
sage: f.one_curve(n, B1=500000, algorithm="P-1") ## line 176 ##
[67872792749091946529, 6366805760909027985741435139224233]
sage: n = 2088352670731726262548647919416588631875815083 ## line 178 ##
sage: f.one_curve(n, B1=2000, algorithm="P+1", x0=5) ## line 179 ##
[328006342451, 6366805760909027985741435139224233]
sage: sig_on_count() ## line 181 ##
0
sage: f = ECM() ## line 241 ##
sage: n = 508021860739623467191080372196682785441177798407961 ## line
242 ##
sage: f.find_factor(n) ## line 243 ##
[79792266297612017, 6366805760909027985741435139224233]
sage: f=2^2^14+1 ## line 247 ##
sage: ecm.find_factor(f) ## line 248 ##
sage: sig_on_count() ## line 252 ##
0
sage: ecm.factor(602400691612422154516282778947806249229526581) ## line
333 ##
[45949729863572179, 13109994191499930367061460439]
sage: ecm.factor((2^197 + 1)/3)           # takes a long time ## line
336 ##
}}}

URL: http://trac.sagemath.org/15443
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): François Bissey