Update to Java 8, replace anonymous classes with lambdas