Updated detection
- Checks that $detection is a class before trying to instantiate
- Allows passing of a config object to satisy dependency injection
- Updated tests