Artificial intelligence -- and a few jokes -- will help keep future Mars crews sane