Misc performace improvements. More local variables. Map now generates up to 2x as fast as before. Prints map generation time.