Fix long line length
Move py2/3 platform differences to compat module
Use compat module imports in mmap module