moved table-caching to sql-class, added setting for tablecache - yes/no