Add public sort and compare functions.
Add extern qualifier.
Fix CURL detection.