First run refactoring

Refactored all the code, though I may have missed some things. We are
now mostly using oracle's java coding standards.