added in much of the foundation code needed for sql evaluation change (currently it's all unused code)
added in much of the foundation code needed for sql evaluation change (currently it's all unused code)

Ignore-this: 1f8700fdd2e29ea7a5d86e8ac370aa27

darcs-hash:20091122170052-b3b23-cff1e9621049277c289b789c7799df27da4c4278.gz

keithshep/txt-sushi