Basically, every time you see state()->something() it needs to be converted into state_something(). Object oriented to procedural.  The only trick is that our state_get() function also takes a second parameter, and that's the default value.  So lines like these need a little more attention.

    $cache = array_keys(state_get('system.js_cache_files', array()));