Refactor of Environment class

Changed behaviour of application to not depend upon GUI but on
Environment. To achieve this the inner Binding class is extended and the
references to Widget have been rewritten to use the environment class.