the flask tutorial microblog slightly refactored, with tests