Add a helper to generate shared variables for a parameter.

Tweak naming conventions to use _tm1 for "previous value" and _t for
"next value".
Make HF test take much less time!