Compiling monolithic C++ extension under setuptools. Additional code refactoring.