Define fns for Java 7 conditionally

This fixes the problems with breaking compatibility mentioned in #54.