Python 3 compatibility and DbEngine

Abstracted instance checking from DbEngine descendants