Replaced java.io usage with java.nio.file where applicable, fixes #1