added tests and fixed basic metadb polling and cache updating