Test storage of intermediate results.

We use a SideEffects node to check the amount of invocations the node
has done, and create a diamond-shaped network where both inputs of a
node connect to the side effect node.