More substitution methods; cleaned up control loop

Now control sets break the loop when the done flag is reached.

Also added some more wildcard substitution.