ScriptRunner: handle object prototypes better

It now handles the same basic cases as the convertValue method does.
ScriptRunner: use generic RType conversion method

This method is great except for throwing a RuntimeException when
wrapping fails. In that case, we catch it and fall back to default.