Feature/issue 675 check autodiff

#### Summary:
This addresses issue #675, issue #701, and issue #309 (?). It checks to make sure all functions and matrix operations support higher order autodiff (at least up to 3rd order).

#### Intended Effect:
No intended effect--just a check on higher order autodiff.

#### How to Verify:
Look at unit tests.

#### Side Effects:
None. Some math functions were generalized in order to allow for higher order autodiff, but I ran the unit tests afterwards and nothing went wrong.

#### Documentation:
None.

#### Reviewer Suggestions:
Anyone.