Create Lego Power Functions IR for Imp-agent

This is the second part of the code.