Refactored EditActivity logic into controllers.
Todo of new entries is now determined by last sibling of parent.
Improved check for "Are you sure you want to discard changes" prompt.