Missing output encoding for templates
FileStorage for sessions replaced by CachedMemoryStorage; Stats access and events updated in engine
ThreadPool fixes: queue.task_done() was not being called for all tasks, and kill_threads called with wrong argument from console cmd