Added invFlag DB queries
Added database settings file
Added cache skeleton, refactored the way Mysql DB queries are made and changed Agent queries, other queries to follow