Added CodeStream as a parameter to the value building process so we can use some of the data it has.
Got substitution working (at least on level 0).  Possibly leaking some memory but this will have to be studied later.