moving more functions out of memcache script to functions/wikilib