Port to Frege and support to define modules in REPL