Rework ConnectInputs to clarify structure.

Rewrite the CTransaction::ConnectInputs function a bit to clarify the
structure and help with future optimisations with respect to game
transactions.