Rework clipboard inserts/updates.

When creating or updating the clipboard, a ClipboardEntry is now
expected instead of a regular string. This allows more intelligent
decisions regarding updates and inserts and simplifies operations
on existing entries.
Add runtime whitespace trimming.

Clip is now able to use a dynamic whitespace trimming policy selectable
at runtime. This changes how Clip stores data: it now stores the
originally selected text (including all whitespace) and only applies the
trimming at paste time. This makes trimming non-destructive.
Add numbers to the first 9 rows.

Previously, it was difficult to determine which number accessor
correlated to which entry. This is more clear now that each row number
is visible.
Minor efficiency impromevents.
Add row joining.

When a menu entry is currently selected, pressing 'J' will cause the top
record to merge with the bottom record, similar to the join behaviour of
Vi. Joining a row will not activate it, allowing multiple joins to be
made in one trip to the dialog. Finally, the usage counter is inherited
from the left-most entry, as opposed to merging the counters. This was
done to prevent entries from remaining around for too long.

This commit also fundamentally changes the way the way the clipboard,
history, and GUI handle and store data. In particular, there is a
heavier emphasis on shared and reused references.
Allow editing to be on a per-entry basis.

Previously, entry editing could only be performed on the head element.
This change allows any selected element to be edited by pressing "e"
(just edit) or "E" (promote to current).
Always load clipboard value at startup.
Made Entry IDs portable.
Selected entries can be locked by pressing "l".

In addition to locking by right-clicking, a selected entry may now be
locked by pressing "l".
Segfault when locking unselected record.
Add option to change case.

By pressing "u" or "U", the selected entry's case will be completely
changed, respectively, to lower or upper casee.
Error handling for failed operations.
Add manual trim/strip operation.

Pressing "t" will left and right trim the currently-selected entry.
Code style changes.
Add a duplication detection.

This change introduces a duplication detection mechanism that computes
the Levenshtein distance between existing entries and new entries to
determine if they are logical duplicates. By default, this is only
applied to the top 10% of all records so that history doesn't become
sporadic. More specifically, this implementation considers records as
duplicates only if they are similar in both time and space.

This feature is mainly intended to reduce the number of duplicate values
that would otherwise clutter the history by assuming that the last
record selected is the "correct" record.
Remove conflicting history entries.

When changing history entry A to contain the same text as history entry
B, a unique constraint would be violated. This change eagerly determines
if another entry will conflict on an update and deletes it.
Removed event/history coupling.
Event publication logic bug.

When a clipboard event was fired, GUI would sometimes free the actual
clipboard entry and its underlying text. When this same entry was used
subsequently (an update, perhaps), a null dereference occurred.
Compare logical clipboard value with provider.

When evaluating the provider's set value, the clipboard's preprocessing
(such as trimming) should be used as a logical comparison. This
eliminates the number of false positives and reduces the number of
actual lookups that need to be performed.
Levenshtein function had stack-bound matrix.

When adding large values to the clipboard, the stack would overflow.
This resulted from the Levenshtein distance implementation using a
stack-bound matrix.