Refactor MD5 code. Add unit test for FileFinder.

Summary: FileFinder::find() now uses PHP's md5_file() for all MD5 calculations and now has associated unit tests.

Test Plan: Ensure the unit tests pass.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5013
Do not calculate checksums of directories.

Summary: Add a condition to avoid calculating the checksum of a directory and add corresponding unit tests.

Test Plan: Ensure unit tests pass.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5018
Fix profiling Conduit calls

Summary: This error was masked by resolving HTTPS futures in serial.

Test Plan:
  PhutilServiceProfiler::getInstance()->enableDiscardMode();
  $conduit = new ConduitClient('https://secure.phabricator.com/');
  $futures = array(
    $conduit->callMethod('conduit.ping', array()),
    $conduit->callMethod('conduit.ping', array()),
  );

  Futures($futures)->resolveAll();

Didn't see:

> Notice: Undefined offset: 2 in libphutil/src/serviceprofiler/PhutilServiceProfiler.php on line 42

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5027
Fix generating random bytes under Windows

Summary: I'm hopefully the only user of this.

Test Plan:
  $ arc unit

See no more:

> Uninitialized string offset: 19 at [libphutil/src/filesystem/Filesystem.php:394]

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5029
Fix parsing of XHPAST parse error

Summary: This is the real problem in D5043.

Test Plan:
Linted file with XHP:

  lang=xml
  <a>&
  </a>

Reviewers: epriestley, nh

Reviewed By: epriestley

CC: aran, Korvin, s.o.butler

Differential Revision: https://secure.phabricator.com/D5044
Introduce a class for calculating Damerau-Levenshtein edit distances and strings

Summary:
This helps us attack three problems:

  - We currently can't give string transpositions a cost when evaluating British spellings for `arc`, so "alnd" has equal edit distances to "amend" and "land".
  - The intraline differ isn't UTF-8 aware, and the algorithm is character oriented.
  - ArcanistDiffUtils::buildLevenshteinDifferenceString() is a tangled mess of disgusting garbage.

Introduce a better-factored implementation of Damerau-Levenshtein with options to price trnspositions and build edit strings.

Test Plan: Unit tests.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2379

Differential Revision: https://secure.phabricator.com/D5032
Provide more detailed exceptions when symbols fail to load

Summary: Give the user everything we can when this happens.

Test Plan: Added a `new ZZ();` call to trigger the first case. Renamed `Future` to `Futurexyz` to trigger the second case. Grepped for other throwers.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D5037
Allow SimpleOptions to parse quoted keys and values

Summary:
Ref T2574. Currently, the SimpleOptions format seems pretty good for use in Remarkup, but does not permit characters like "," and "=" to be included in strings.

Allow keys or values to be quoted, so inputs like `name="Bartholemew, High Lord of Ravnica"` are parseable.

Test Plan: Expanded unit test coverage.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2574

Differential Revision: https://secure.phabricator.com/D5047