added callback for do_bfgs_optimize at every iteration
adding failing Phi test for src/stan/math/functions/Phi.hpp
fixes #850. throws exception on nan input
updating call to error handling to use C++ style static_cast instead of C style cast
Merge pull request #851 from stan-dev/feature/issue-850-erf-nan-input

Fixes #850. Feature/issue 850 Phi nan input
Merge pull request #840 from stan-dev/feature/issue-768-interruptions-for-bfgs

Fixes #768. added callback for do_bfgs_optimize at every iteration
Merge branch 'develop' into feature/issue-823-check-multi-prob-autodiff