Issue #148 Refactoring Square to remove gui/swing related code