Restructure ownership of models and views to possibly fix crash on exit.