Made libmodplug an external dependency, made the CMake script work and fixed a small bug in the code.