Many bug fixes for StateCache, ModelCache, added Exception and Listeners