Converted all functions in templater.inc to use the new query function
Updated the login script to use the new query function