map gen

map generates faster, lib used, some small tweaks in other scripts for
compatibility with this new lib