mlib and munit setup and fixes for prime-layout