Split circuit into multiple files

Moved gate dragging logic from the gate class to the circuit.