Added new modal and altered envelope code
Added #wrap node to aid modal and fixed bug when closing envelope