Add the cache_replace_test, improve the Makefile, and Fix bug25