Countdown revamp 2

Summary:
Now has policy support (not really)
Now uses CountdownQuery
Now has handles
Now uses common way for remarkup
Remarkup still looks terrible

Test Plan: Added countdowns, edited countdowns. Did even embed some. Couldn't break it

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

Maniphest Tasks: T2624

Differential Revision: https://secure.phabricator.com/D6012
Stop writing empty strings to the ownerPHID column

Summary: If we're unassigning an owner from a task it should set the column to `NULL` rather than an empty string. Fixes T3239

Test Plan: Assigned and Unassigned a task. Make sure the db is doing as excpected. Ran the patch, checked the db.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3239

Differential Revision: https://secure.phabricator.com/D6017
Token - fix fatal for installs with no tokens yet given

Summary: fixes github issue 326

Test Plan: visited /token/leaders and observed no fatals.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6021
Add a basic multipage form

Summary:
Ref T2232. Very busy day on IRC so I feel like I've made 20 minutes of progress in 1-minute spurts here, but this adds the basics for a form that can have multiple pages and automatically handle pagination and reading to/from the request, objects and responses.

The UIExample is reasonably instructive. Basically, you make a form, add pages to the form, and add controls to the pages. The core flow control looks like this:

  if ($request->isFormPost()) {
    $form->readFromRequest($request);                 // (1)
    if ($form->isComplete()) {                        // (2)
      $response = $form->writeToResponse($response);  // (3)
      // Process result here.                         // (4)
    }
  } else {
    $form->readFromObject($object);                   // (5)
  }

The key parts are:

  # This reads the form state from the request, including reading all the inactive pages.
  # This tests if all pages are valid and the user just clicked "Done" on the last page.
  # This produces a "response", which might be writing to an object (for simpler forms) or creating a transaction record (for more complex forms).
  # Here, we would save the object or apply the transactions.
  # When the user views the form for the first time, we preload all the values from some object (which might just be empty).

Ultimate goal here is to fix repository creation to not be a terrible pit of awfulness.

There are probably a lot of rough edges and missing features still, but this seems to not be totally crazy.

I'm using two submit buttons with different names which doesn't work on IE7 or something, but we can JS our way out of that if we need to.

Test Plan: Paged forward and backward through the form.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2232

Differential Revision: https://secure.phabricator.com/D6003
Add setup checks for the availability of 'which' and 'diff' binaries

Summary:
Spent an hour or two helping a user figure this out. Make sure I never do that again.

If the webserver is configured with an empty or bogus PATH, binaries like 'which' and 'diff' (and 'git', and 'svn', etc.) may not be available. In most cases, this is fine, because we get an error like "sh: whatever-command not found", which is obvious to diagnose.

In the case of 'diff', we don't get this, because 'diff' is expected to exit with a nonzero code for differing files -- so we interpret the "sh: whatever-command not found" as "files differ" and then try to parse the empty output.

Explicitly check for 'which' (on Windows, 'where') and 'diff' during setup (I plan to refine the behavior around 'git', 'svn' and 'hg' at some point, but this is less pressing since the errors are trivial to support).

Test Plan: Faked failures on all modes, verified setup warnings look reasonable.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

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