New msgtx generation

decoratedTx.changeIndex has been removed and replaced with a function instead.