Gitignore for Java, Eclipse, IntelliJ and OSX
Fixed some imports and whitespace issues.
Some minor (major) refactoring.