Model now saves checked state of tasks.
A bit of refactoring. Added some comments.