Increase code quality.

- Remove dom4j compile dependency.
- Fix sonar violations (Sonar way with Findbugs).
- Increase code coverage.