Added exit flag and function exit() to Console class