more support for text segment, refactor rma helper
add the original license file for portals-shmem since it is diff than mine