Refactor conversions from LazyMetadataValue into abstract base class

Implementing MetadataValue interface is significant work due to having
to provide a large amount of conversion stub method. This adds a new
optional abstract base class to aid in implementation.

Includes comprehensive unit tests including a sample adapter class, and
all existing metadata tests pass.
Clean up whitespace.
Substantially more comprehensive unit tests.

Check all the interesting implementation details in metadatavalues
which were never tested before, as well as making sure we document
things thoroughly.
Prevent classloader leakage in metadata system. Fixes Bukkit-3854

Metadata values keep strong reference to plugins, and they're not
cleared out when plugins are unloaded. This system adds weak reference
logic to allow these values to fall out of scope. In addition we get
some operations turning to O(1) "for free."