Added task update functionality

Also moved flashed messages to layout.html and simplified
data access in pytodo.py a little bit.