cleanups + start working on a new mapscript system (in order to separate it from maps themselves)