Started implementing an MVVM pattern

... and reorganized previous classes to make the MVVM pattern more
clear.