Move log-prob and gradient calc back into main function
Move log-prob and gradient calc back into main function

stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math