Added hint type to wrap.

There is no way for the wrap method to reliably work across the board
without the hint type, because of the fact that we may be searching for
a particular interface type, of which the concrete item may implement
several reasonable options for. If Java had runtime generic reflection,
we could get away with this as is, but unfortunately, as it does not,
we have to provide the type hint ourselves. This will still eliminate the
few casts that were in some places, and is generally better practice than
returning <T> T anyways.

I still have to go through and update all the classes that used the wrap
method, but that will be included in a separate commit.