Fixed a bug with scoped environments, added a test for it. made some progres on the viewing of the form.