Port classes to Java 7 and ThreeTen backport