Added f_native.
Minor change.
More efficient caching when differentiating.
Making dimensionality global.
Minor fix.