Clean up and reorganization of files, work on Java version.