Text based user interface in javascript