Fixed LPDocument errors and created LPMetadata to store information about the circuit (e.g., selected gate, active gate type, etc.).