continued fractions functionality enhanced and added to ntheory module

Patch for "Issue 3937: Enhancements on continued fractions" [1]

[1] https://code.google.com/p/sympy/issues/detail?id=3937&q=thilina&colspec=ID%20Type%20Status%20Priority%20Milestone%20Reporter%20Summary%20Stars