Changes to rake and sql scripts prior to dummy run 3
Changes to rake and sql scripts prior to dummy run 3, again.
GOOD versions of scripts. All latest changes made as at 20130320.