add mmap support
re-factor load/save