Improve cache handling by combining state stored in separate files into a single file. This helps performance as well as cleans up some of the code. (FELIX-2619, FELIX-2626)