implemented repl mode

also applied many changes for read procedure and relatives