Add "PhutilDirectedScalarGraph"

Summary: Ref T4068. I need a non-fancy version of this to topographically sort commits.

Test Plan: See next revision.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4068

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