Implement derivative framework and some general fixes.
Merge pull request #1 from jordandukart/7.x-derivatives-and-fixes

Implement derivative framework and some general fixes.