Fix envelopes rendering (incorrect loading)

I didn't load the envelopes of older maps correctly ingame.
Also cleaned up the editor code a bit