Improved Extension tests and error handling

- Throw a meaningful exception if a persistence layer has not been
  activated
- Added test for the DI Extension