Support for substitutions.

Changed behaviour from what was planned in the tests: subs-ing a parameter does
not remove that parameter from the parameters list.  This may be further
re-thought eventually, but it works for the simple cases now.