Fixes #4957: Adds service provider based on DI container
Merge pull request #505 from mrclay/4957-rebased

Fixes #4957: Adds service provider based on DI container