Merge pull request #196 from angathorion/gui-tests-and-tweaks
Implemented some unit tests. Tweaked GUI and refactored code.

(main@f626981a090db6b0f73d934fd7a49f05053435bc)