Replaced StateAttach/StateDetach functions

Replace StateAttach/StateDetach functions in game states with initialize
and cleanup