I think I finally figured out namespaces.

I added the app/lib folder and modified composer.json to load it in. I'm now thiking about how to organize the code so that search results can be abstracted with classes that I put in the Services folder.
Restructured a lot of the code. Decided to have the retrieval of catgeories and product lines handled by Services in the app/lib folder.