Fixed serialization on Java 5

- use the public method ObjectStreamClass.lookup() when running on Java 6 and later
- use reflection to get at the method when running on Java 5.