Add type-hinting to the cache API
While working on adding the Memcache module, there were some issues discovered with arguments passed to some cache API functions. The functions expect strings, but were receiving arrays.
Add some type-hinting to make sure the cache API is used as it is intended and fix any bad calls.