All sql queries have been written. They just need testing with the new DB now.
Merge branch 'master' of https://github.com/Spitigala/ESA