JUnit test improvements.
Minor refactorings.
Additional IntelliJ files added.