Move mmap detection routines to a separate file