Create cache rebuilding tool

Change-Id: Ifff9840395a08d9b707cd18ebf985cc531e39927
Change precedence of operations to be more natral, hopefully

Change-Id: I81341f66e5697794fe3fef1606f2102b6ad40e59