Java formatter refactoring

As a first step towards moving the JavaFormatter to use Velocity, this PR untangles the  JavaFormatter class into much smaller, more focussed classes