Add support for Java classes

- Adds support for pickling Java classes using getters and setters.
- Adds support for Java-style singletons that have a public static `getInstance()` method.