refactor client-side model store into a service
refactoring

some preparation for adding history
also some unrelated cleanup