Moved map-specific functions into map.h / map.c library.
Addendum to previous commit: Added files mentioned but forgotten.