Refactoring some objects to use interfaces.
Fixes for logging/etc