Add a `cached` function to `synapse.module_api` that returns a decorator to cache return values of functions.