Merge pull request #747 from ThomasWaldmann/sprint-branch

replace 1/0 by 1 // 0 to get rid of DeprecationWarning (and PEP8 issue)
Always return a list from get_flashed_messages
Enabled test mode for an app
Close request objects if they support closing.
fix issues in test_context_refcounts that were unnoticed yet as they did not make the test fail
flask view function may return bytes/str/unicode