Implement caching
Make the cache work
Move logging macro