Implemented some unit tests. Tweaked GUI and refactored code.

Is this bad practice?