Handle database namespaces for cached tables

Cached tables currently ignore database name which makes caching buggy for users using multiple databases.
Enhanced the memoryMetadataManager to require database name inaddition to the tablename for all metadata operations.