Refactor providing dependencies when calling functions

This is related to #7 + possibly flask_injector