Moved all sql to one file.

Separating the gui and sql elements into separate files.