Replace compseg with ca_buffer
Replace pictable, picmtable and spritetable pointers with vector
Fix CAL_SetupGrFile
Add thread for ticks