Massive autoformat

Just cleaning the code, removing unused imports and variables, filling
incomplete Javadocs, etc.