Added ability to handle multiple independent closures.
Still working out the bugs.
Fixed issue with re-running the same grad function in a closure.