Add wrap() and unwrap() methods to rtypes.java (rebased onto develop)



This is the same as gh-2418 but rebased onto develop.

----

As originally suggested by @ctrueden in http://git.io/0F7HXA
(DefaultOMEROService.toOMERO), these methods take or return
arbitrary graphs of object/rtypes. See http://git.io/9roMWw
for the original implementation in Python.

This implementation includes a cache so that cycles in the
graph are short-circuited.