Major refractoring of dimension functions

The order and logic of the data generating functions have been changed
significantly. The largest change is that the sql used to build the
dimensions on the server has been moved to separate sql files. These sql
files are "pre" and "post" sql in the sense that the pre.sql file sets
up the server so that the dimension sql can be run and then the post.sql
file does analysis required by HDPS.

A debug mode has now been added which keeps any sql commands from being
issued. Furthermore, a record of all sql calls (or those which would
have been called in the case of debug mode) is saved in a temporary
directory.