Feature/issue 1031 nested reverse mode autodiff

#### Summary:

Adds the ability to do nested reverse-mode autodiff, which is necessary for the ODE integrator.

#### Intended Effect:

Allow nested reverse-mode.  In the middle of a reverse mode, mark the position, do another reverse mode, then pop back to where you were.

#### How to Verify:

New unit tests for nested behavior. 

#### Side Effects:

Yes.  It removes the `recover_memory()` call from `grad()`, which moves responsibility for recovering memory back to the calling function.  

It also makes the recovery of memory more robust in `agrad/autodiff.hpp` with proper try/catch behavior.

#### Documentation:

Not user facing.

#### Reviewer Suggestions:

Anyone familiar with the guts of reverse-mode autodiff.
Doesn't `recover_memory()` need to now clear these variables?
- `nested_var_stack_sizes_`
- `nested_var_nochain_stack_sizes_`
- `nested_var_alloc_stack_starts_`
In other words, shouldn't there be lines like: `nested_var_stack_sizes_.clear(); nested_var_nochain_stack_sizes_.clear(); nested_var_alloc_stack_starts_.clear();` inside the function?
I think the delete has already been called, but if any of these stacks are non-zero size, then they'll remain non-zero size, which would be an inconsistent state.