[LMP] Proper sorting if there are non-local files.
[LMP] Sort non-locals by URL instead of hash.
[LMP] Link to libguess (hardcoded for now).
[LMP] Try guessing encoding via libguess.

Probably fixes #1230.
Probably fixes #1272.