Move to maven, refactor package hierarchy