vaguely-working support for use-site variance for Java backend

This is surely wrong/incomplete in various ways, but at least I can compile and run basic examples. I don't suggest that you guys merge this without thoroughly reviewing it first.