Test time entry model.

Add some tests for TimeEntryModel to validate the business logic in it.
Fix not setting stop time when stopping time entry.

Time entry tests (from 1e50d08) revealed that the StopTime was not being
correctly set when the time entry was stopped.