Refactor to avoid duplication
Add runtime test
Add test and expose in Python
By adding the necessary Eigen header for real type of autodiff