Fixed problem with virtual function changing const-ness

Since CalculateContractID() should be const, but it uses UpdateContents() (obviously non-const) to temporarily modify its contents, I created an extra CreateContents() member function (const) that will calculate the updated contents into an out parameter. This function is now used by both, thereby satisfying the const-ness of CalculateContractID().