Removes dependency cycles between packages (issue #2).
Resolves some additional sonar issues. (#2)
Two issues, a dodgy and a correctness one, reported with the Sonar
FindBugs profile. (issue #2)