Removed redundant code, 
added exporting to lua tables, 
added gui to choose export option, 
changed the way the map is handled to be more efficent.