Added a crash log system, other code changes.