Update TypeScript code to utilize p5 Instantiation pattern