Setup checkstyle
Refactor and fix many checkstyle errors