server: refactored Flask setup into factory module
server: refactored celery extension and init; suggested app_context pattern