Creating a new internal function to find ring_state_dir; changing a couple of functions to use the new function.