Replaced caching with Flask-Cache
Moved scheduler into main thread.