Implementing support for multiple libraries by adding an additional implementation CEi which takes an instance of the native library to use.
Note: This duplicates a lot of code so some refactoring is needed.