added two tests that fail in gamma_q chain calculations
refactored code. The same implementation was in src/stan/prob/internal_math.hpp. This doesn't solve the infinite loop problem.
updating stan/prob/internal_math function to throw an exception when the sum diverges
changing error condition to when there is actually an error
Merge pull request #418 from stan-dev/feature/issue-333-fix-gamma_q-chain

Fixes #333.