update continued fractions code based on http://trac.sagemath.org/sage_trac/ticket/8017
update various examples to reflect misc changes to sage -- now all tests pass.