added agrad fwd and rev function definitions
added unit tests for auto-diff versions