Move rmem.h out of frontend headers