Refactoring the code - First pass

1] Added helper functions for the various heuristics
2] Improved the documentation
3] Rewrote the second heuristic according to a new algo
Made the following changes

1] PEP 8 modifications
2] Changed the structure of infinitesimals similar to dsolve
3] Used dummy instead of Symbol
4] Updated sphinx docs
Added Value Errors and Not Implemeted Errors
Fix typo
UnXFAIL test_real_Pow

    This test doesn't fail anymore.  And mentioned in docstring
    statements (pi/log(x)).is_real is NOT True (with no assumptions
    on x) long time ago, since commit 6ee8b34.
Fix and UnXFAIL test_rational_products
Fix and UnXFAIL test_wallis_product
Fix and UnXFAIL test_gosper_nan
Karr convention: change limits in doit() for symbolic integers

    This is a small modification for commit dda493
Don't import sympy in isympy

This fixes issue 3949.
Merge pull request #2317 from asmeurer/isympy-import

Don't import sympy in isympy
Merge pull request #2286 from Manoj-Kumar-S/refactor

Refactored the heuristic code and rewrote the second heuristic
Merge pull request #2315 from skirpichev/misc

Misc small fixes
Merge branch 'master' into 2482-unbundle-mpmath
Fix docs