Got a generic engine for all versions working

There are still a few refactorings required to at least use more
interfaces and less concrete classes