This change also simplifies the site index query.
Moved all the of the sql out of the init file and into it's own directory.