New widget system

I split the main into several smaller modules in order to keep it more
clean. The whole thing is now inside an application class to share
'global' data and gives more possibilities when coding new routines that
have to store data which will be used inside other routines. BUT i now
dont have support for the positioning of the layer inside edit_frame. It
will follow in the next two commits.