Making cacheToFile  key more resilient against mixed/nested types

Previously if you passed in a nested array, or perhaps an array of objects, the implode call would throw an E_NOTICE error with an array to string conversion.

This method is more robust by giving a generally shorter file name length, and by ensuring we always get a string out of any kind of arguments passed in.