Refactor providing dependencies when calling functions

This is related to #7 + possibly flask_injector
Merge pull request #23 from alecthomas/refactor-calling-and-injecting

Refactor providing dependencies when calling functions