Allow renderering Remarkup to text

Summary:
This will be useful mainly for `D123` and `{D123}` in text e-mails.
I've consider also other approaches:

# Convert the rendered HTML to text - we lose some information when converting Remarkup to HTML, e.g. whether `##` or ##`## was used.
# Return the Remarkup intact, e.g. in simple table or lists (after applying inline rules) - tables and lists formatted by computer usually look better than the ones from users.
# Create a separate text renderer - HTML and text renderers share lots of regular expressions and code so splitting them would create more complexity.

The mode is a bitmask to allow something like `self::MODE_TITLE | self::MODE_LINK` in future.

Test Plan: Old and new unit tests.

Reviewers: epriestley, edward

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2617

Differential Revision: https://secure.phabricator.com/D5365
(Key,Value) cache can now use namespace

Summary: (Key,Value) pairs can now be cached using namespace

Test Plan: arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2786

Differential Revision: https://secure.phabricator.com/D5400
Improve hardwrapping for input with newlines

Summary:
If input text has newlines, `phutil_utf8_hard_wrap` currently does not reset the wrap counter upon encountering a newline. This is consistent with `phutil_utf8_hard_wrap_html`, but inconvenient.

Instead, process it in a line-oriented way to improve this behavior. Fixes weird diffs in Phriction.

Test Plan: Diffs in Phriction look less weird now.

Reviewers: chad, kwadwon

Reviewed By: chad

CC: aran

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