Exctract a factor() from isprime() and tidy up a bit in natural.py

The implementation of isprime() could actually returna proper factor (when input
isn't 0 or a unit), so break that function out of it.  Revised a slight
imprecision in the proof that a rational is whole if its square is.  Refined
documentation of desquare, turned one comment into an assertion, added another
comment.
Refined Collatz().
Tweaks to depower(); clearer phrasing, new comments.
Reworked depower and fixed some bugs.

Doing the t *= v * (p + 1 - i) step late in computing successive terms in the
inner loop's sum lead to an assertion failure when the factor of i by which
we're dividing actually comes from the p+1-i we're multiplying by. So shift that
step earlier.  Also unroll the val = 0 pass through the outer loop, where we
know by construction that the top bit is to be set in v; restructure the outer
loop to route all returning to the end while avoiding some duplication; and
assert some more truths.