Updated the query builder for mysql.
Fixed some jslint notices.