Included circuit in test compilation
Remove circular dependency by using forward declaration
Initialize retval in gate factory to prevent compilation warning
Initial circuit implementation with simply storing gates