Audit usage of get_dyn_STATEDIR() and replace with state_path()