cmake: add memenv lib and test