move conversion of memory term msgs to/from pyclp to memory lib