Converting PHP library scripts to Yii application

I am new to yii and using version 2. I developed a project which uses a library (I coded) for parsing a CAD model file, extract vertexes, edges, faces etc, finally combine those entities to display the model and then extract features. It displays the model using the three.js library. A user has to be signed-in in order to upload the model file and do all this stuff. I would like to refactor the app into version 2 using the yii 2 framework. So I would like to know how I can merge the feature recognition library into the yii app, should I create a Components, Extension or Module or use other means?

The library is coded in plain OOP. I access it by requiring an init.php file which requires about 20 library class files. If I create a module for the library the view will draw the model but how and where do the parser and feature extractor go in the model or controller files?

Thanks in advance.

Maybe you could consider your library "3rd party code"?