Moving State and FileCache to lib.