Feature/issue 824 check matrix autodiff

#### Summary:
Fix issue #824  by checking all of the matrix functions in stan/math to make sure they work with higher order autodiff (up to 3rd order).

#### Intended Effect:
Make sure all matrix functions work with higher order autodiff.

#### How to Verify:
Run unit tests.

#### Side Effects:
No.

#### Documentation:
None.

#### Reviewer Suggestions:
Anyone.