expose current global_state_version to ruby land
remove unnecessary invalidations
split out cache into method state version and constant state version