Refactoring to use container

This PR will introduce dependency injection, fixing #35.and tidying up the mess of helpers.
Decided to use the Symfony DI Container instead of Pimple as I guess its more likely to be already available when run in embedded mode.