clean up SQL a bit

Conflicts:
	fannie/batches/CAP/CoopDealsReviewPage.php
convert results_content() to use own SELECT statement, rather than POST data
clean up debug echos, commented-out code; add newlines to preview table output
Merge in fixes from Ypsi. Use DB-abstraction for string concatenation,
unwind tabs into spaces, use jQuery-ui for datepickers