Simplified main program by moving big generic slabs into include files, and optimised out an NTSC timing problem