Allow easier overriding of cache request key

Plus some minor PEP8 modifications.