Revert "Got rid of internal istreams."

This reverts commit 0f659602d139ffeeb38453caef02d96d356efb7a.
Revert "Added database tuple."

This reverts commit 93d5925177579b332e18bc2fae6ddbecd4f08a52.