Fixed another small memory leak
Clean up previous project whenever we switch views.
Persist view changes. Fixes #118.