Map engine changes

Fast map engine, plus functions as map scripts.