Default to openssl_random_pseudo_bytes instead of /dev/urandom.

Summary: When available, prefer php's built in openssl_random_pseudo_bytes() to /dev/urandom.  Test for functionality and fallback to /dev/urandom if necessary to get data.  Simplifies the code a bit, and is somewhat more functional as running inside a chroot is now possible.

Test Plan: Add unit test for readRandomBytes() Would be nice to have someone test this on windows.  Working on ubuntu at the moment.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7528
Allow using numbers and HTML fragments in translations together

Test Plan: Wrote a test, watched it fail.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7532
Add `urisprintf()` for encoded printing of URIs

Summary:
Ref T1049. This is primarily to enable us to do a reasonable job of variable replacement in "Request URI" Harbormaster build steps. For example, the user will enter:

  http://jenkins.mycompany.com/?diff=${buildable.name}

...which we'll transform to:

  http://jenkins.mycompany.com/?diff=%s

...and then build correctly.

Test Plan: Unit tests.

Reviewers: btrahan, hach-que

Reviewed By: hach-que

CC: zeeg, aran

Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D7538
Provide helper function for <div class="%s">%s</div>

Summary: I don't like helper functions but this is used often and it makes the code more readable.

Test Plan: Will use it.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7545
Allow self-closing <frame>

Test Plan: Used in `PhabricatorXHPASTViewFramesetController`.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7548
Allow PhutilChannels to have their write channels closed explicitly

Summary: Ref T2230. This simplifies some tests and cleans up some TODOs in the hosting stuff. See `testCloseExecWriteChannel` for an example of where we need this in practice.

Test Plan: Ran unit tests; commented out the `closeWriteChannel()` calls and got test failures instead of hangs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2230

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