Prepare for proper Truffle function call API.
Heavy refactoring to not save the state in a TruffleFrame.