Refactoring the REPL - runtime API. Towards adding interpreter