Migrated a ot of the content from the tuesch to the iwmlib. This is before the decoupeling of the layers.